Beispiel #1
0
 def test_get_all_run_metadata_keys(self):
     run = api.create_run()
     meta_dict = {
         'test_a': 'a',
         'test_a': 'b',
         'test_b': 'a',
         'test_c': 'a',
         'test_d': 'a',
         'test_c': 'b',
     }
     api.add_run_metadata(meta_dict, run.id)
     keys = api.get_all_run_metadata_keys()
     self.assertEqual(sorted(['test_a', 'test_b', 'test_c', 'test_d']),
                      sorted(keys))
Beispiel #2
0
 def test_get_all_run_metadata_keys(self):
     run = api.create_run()
     meta_dict = {
         'test_a': 'a',
         'test_a': 'b',
         'test_b': 'a',
         'test_c': 'a',
         'test_d': 'a',
         'test_c': 'b',
     }
     api.add_run_metadata(meta_dict, run.id)
     keys = api.get_all_run_metadata_keys()
     self.assertEqual(sorted(['test_a', 'test_b', 'test_c', 'test_d']),
                      sorted(keys))
Beispiel #3
0
def get_run_metadata_keys():
    global config
    try:
        if config:
            ignored_keys = (config.get(
                'default', 'ignored_run_metadata_keys').splitlines())
        else:
            ignored_keys = []
    except ConfigParser.NoOptionError:
        ignored_keys = []

    with session_scope() as session:
        existing_keys = set(api.get_all_run_metadata_keys(session))
        allowed_keys = existing_keys.difference(ignored_keys)

        return jsonify(list(allowed_keys))
Beispiel #4
0
def get_run_metadata_keys():
    global config
    try:
        if config:
            ignored_keys = (config
                            .get('default', 'ignored_run_metadata_keys')
                            .splitlines())
        else:
            ignored_keys = []
    except ConfigParser.NoOptionError:
        ignored_keys = []

    with session_scope() as session:
        existing_keys = set(api.get_all_run_metadata_keys(session))
        allowed_keys = existing_keys.difference(ignored_keys)

        return jsonify(list(allowed_keys))