From 2557823d1b074c14366be189d5c6af706dfad449 Mon Sep 17 00:00:00 2001 From: Noah Dove Date: Mon, 21 Nov 2022 13:35:26 -0800 Subject: [PATCH] Absorb renaming of AnVIL fields (#4617) --- src/azul/plugins/metadata/anvil/__init__.py | 2 +- src/azul/plugins/metadata/anvil/indexer/transform.py | 4 ++-- src/azul/plugins/repository/tdr_anvil/__init__.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/azul/plugins/metadata/anvil/__init__.py b/src/azul/plugins/metadata/anvil/__init__.py index 130954e82..5b9296a1d 100644 --- a/src/azul/plugins/metadata/anvil/__init__.py +++ b/src/azul/plugins/metadata/anvil/__init__.py @@ -162,7 +162,7 @@ def _field_mapping(self) -> MetadataPlugin._FieldMapping: # These field names are hard-coded in the implementation of # the repository service/controller. **{ - 'byte_size': 'size', + 'file_size': 'size', # Not in schema 'version': 'fileVersion', 'uuid': 'fileId', diff --git a/src/azul/plugins/metadata/anvil/indexer/transform.py b/src/azul/plugins/metadata/anvil/indexer/transform.py index 0049ed865..4ad660a15 100644 --- a/src/azul/plugins/metadata/anvil/indexer/transform.py +++ b/src/azul/plugins/metadata/anvil/indexer/transform.py @@ -241,7 +241,7 @@ def _file_types(cls) -> FieldTypes: 'file_id': null_str, 'data_modality': [null_str], 'file_format': null_str, - 'byte_size': null_int, + 'file_size': null_int, 'reference_assembly': [null_str], # Not in schema 'version': null_str, @@ -343,7 +343,7 @@ def _file(self, manifest_entry: JSON) -> MutableJSON: metadata = self.bundle.metadata_files[manifest_entry['name']] return self._entity(manifest_entry, self._file_types(), - size=metadata['byte_size']) + size=metadata['file_size']) def _only_dataset(self) -> MutableJSON: return self._dataset(self._entries_by_entity_id[one(self._entities_by_type['dataset'])]) diff --git a/src/azul/plugins/repository/tdr_anvil/__init__.py b/src/azul/plugins/repository/tdr_anvil/__init__.py index e61850207..67b34adcc 100644 --- a/src/azul/plugins/repository/tdr_anvil/__init__.py +++ b/src/azul/plugins/repository/tdr_anvil/__init__.py @@ -519,7 +519,7 @@ def convert_column(value): 'file_id', 'data_modality', 'file_format', - 'byte_size', + 'file_size', 'reference_assembly', 'file_ref', },