diff --git a/dcicutils/_version.py b/dcicutils/_version.py index 28e42f3f6..a3317c88d 100644 --- a/dcicutils/_version.py +++ b/dcicutils/_version.py @@ -1,4 +1,4 @@ """Version information.""" # The following line *must* be the last in the module, exactly as formatted: -__version__ = "0.6.1" +__version__ = "0.6.2" diff --git a/dcicutils/ff_utils.py b/dcicutils/ff_utils.py index 8dca542f6..62530106f 100644 --- a/dcicutils/ff_utils.py +++ b/dcicutils/ff_utils.py @@ -611,6 +611,7 @@ def remove_keys(my_dict, remove_list): frame_resp = remove_keys(es_item['object'], ignore_field) else: frame_resp = remove_keys(es_item['properties'], ignore_field) + frame_resp['uuid'] = uuid # uuid is not in properties, so add it store[obj_key].append(frame_resp) item_uuids.add(uuid) else: # this case should not happen diff --git a/test/test_ff_utils.py b/test/test_ff_utils.py index 83f394f02..0b763666d 100644 --- a/test/test_ff_utils.py +++ b/test/test_ff_utils.py @@ -509,8 +509,11 @@ def test_expand_es_metadata(integrated_ff): test_list = ['7f9eb396-5c1a-4c5e-aebf-28ea39d6a50f'] key, ff_env = integrated_ff['ff_key'], integrated_ff['ff_env'] store, uuids = ff_utils.expand_es_metadata(test_list, key=key, ff_env=ff_env) - assert len(uuids) == 10 - assert 'file_processed' in store + for pos_case in ['file_processed', 'user', 'file_format', 'award', 'lab']: + assert pos_case in store + for neg_case in ['workflow_run_awsem', 'workflow', 'file_reference', 'software', 'workflow_run_sbg', + 'quality_metric_pairsqc', 'quality_metric_fastqc']: + assert neg_case not in store # make sure the frame is raw (default) test_item = store['file_processed'][0] assert test_item['lab'].startswith('828cd4fe') @@ -521,9 +524,7 @@ def test_expand_es_metadata_frame_object(integrated_ff): test_list = ['7f9eb396-5c1a-4c5e-aebf-28ea39d6a50f'] key, ff_env = integrated_ff['ff_key'], integrated_ff['ff_env'] store, uuids = ff_utils.expand_es_metadata(test_list, store_frame='object', key=key, ff_env=ff_env) - assert len(uuids) == 10 - assert 'file_processed' in store - # make sure the frame is raw (default) + # make sure the frame is object (default) test_item = store['file_processed'][0] assert test_item['lab'].startswith('/labs/') @@ -533,16 +534,22 @@ def test_expand_es_metadata_add_wfrs(integrated_ff): test_list = ['7f9eb396-5c1a-4c5e-aebf-28ea39d6a50f'] key, ff_env = integrated_ff['ff_key'], integrated_ff['ff_env'] store, uuids = ff_utils.expand_es_metadata(test_list, add_pc_wfr=True, key=key, ff_env=ff_env) - assert len(uuids) == 73 + for pos_case in ['workflow_run_awsem', 'workflow', 'file_reference', 'software', 'workflow_run_sbg', + 'quality_metric_pairsqc', 'quality_metric_fastqc']: + assert pos_case in store @pytest.mark.integrated def test_expand_es_metadata_ignore_fields(integrated_ff): test_list = ['7f9eb396-5c1a-4c5e-aebf-28ea39d6a50f'] key, ff_env = integrated_ff['ff_key'], integrated_ff['ff_env'] - store, uuids = ff_utils.expand_es_metadata(test_list, add_pc_wfr=True, ignore_field=['quality_metric'], + store, uuids = ff_utils.expand_es_metadata(test_list, add_pc_wfr=True, ignore_field=['quality_metric', + 'output_quality_metrics'], key=key, ff_env=ff_env) - assert len(uuids) == 71 + for pos_case in ['workflow_run_awsem', 'workflow', 'file_reference', 'software', 'workflow_run_sbg']: + assert pos_case in store + for neg_case in ['quality_metric_pairsqc', 'quality_metric_fastqc']: + neg_case not in store @pytest.mark.file_operation