Skip to content

Commit 2fc497f

Browse files
committed
Merge branch 'develop' of github.com:unity-sds/unity-data-services into collection-delete
2 parents e42598b + fce033b commit 2fc497f

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [9.13.0] - 2025-05-29
9+
### Changed
10+
- [#589](https://github.com/unity-sds/unity-data-services/pull/589) feat: daac product.name = granule id
11+
812
## [9.12.0] - 2025-05-24
913
### Changed
1014
- [#585](https://github.com/unity-sds/unity-data-services/pull/585) feat: add ram size in lambdas

cumulus_lambda_functions/daac_archiver/daac_archiver_logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __extract_files(self, uds_cnm_json: dict, daac_config: dict):
9898

9999
def send_to_daac_internal(self, uds_cnm_json: dict):
100100
LOGGER.debug(f'uds_cnm_json: {uds_cnm_json}')
101-
granule_identifier = UdsCollections.decode_identifier(uds_cnm_json['identifier']) # This is normally meant to be for collection. Since our granule ID also has collection id prefix. we can use this.
101+
granule_identifier = UdsCollections.decode_granule_identifier(uds_cnm_json['identifier']) # This is normally meant to be for collection. Since our granule ID also has collection id prefix. we can use this.
102102
self.__archive_index_logic.set_tenant_venue(granule_identifier.tenant, granule_identifier.venue)
103103
daac_config = self.__archive_index_logic.percolate_document(uds_cnm_json['identifier'])
104104
if daac_config is None or len(daac_config) < 1:
@@ -120,7 +120,7 @@ def send_to_daac_internal(self, uds_cnm_json: dict):
120120
"provider": granule_identifier.tenant,
121121
"version": "1.6.0", # TODO this is hardcoded?
122122
"product": {
123-
"name": granule_identifier.id,
123+
"name": granule_identifier.granule,
124124
# "dataVersion": daac_config['daac_data_version'],
125125
'files': self.__extract_files(uds_cnm_json, daac_config),
126126
}

cumulus_lambda_functions/lib/uds_db/uds_collections.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
CollectionIdentifier = namedtuple('CollectionIdentifier', ['urn', 'nasa', 'project', 'tenant', 'venue', 'id'])
15+
GranuleIdentifier = namedtuple('CollectionIdentifier', ['urn', 'nasa', 'project', 'tenant', 'venue', 'id', 'granule'])
1516

1617

1718
class UdsCollections:
@@ -35,6 +36,14 @@ def decode_identifier(incoming_identifier: str) -> CollectionIdentifier:
3536
raise ValueError(f'invalid collection: {collection_identifier_parts}')
3637
return CollectionIdentifier._make(collection_identifier_parts[0:6])
3738

39+
@staticmethod
40+
def decode_granule_identifier(incoming_identifier: str) -> GranuleIdentifier:
41+
collection_identifier_parts = incoming_identifier.split(':')
42+
if len(collection_identifier_parts) < 7:
43+
raise ValueError(f'invalid collection: {collection_identifier_parts}')
44+
return GranuleIdentifier._make(collection_identifier_parts[0:6] + [':'.join(collection_identifier_parts[6:])])
45+
46+
3847
def __bbox_to_polygon(self, bbox: list):
3948
if len(bbox) != 4:
4049
raise ValueError(f'not bounding box: {bbox}')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="cumulus_lambda_functions",
15-
version="9.12.0",
15+
version="9.13.0",
1616
packages=find_packages(),
1717
install_requires=install_requires,
1818
package_data={

tests/cumulus_lambda_functions/lib/uds_db/test_uds_collections.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,18 @@ def test_02(self):
2626
self.assertEqual(aa.venue, 'DEV', f'wrong venue')
2727
self.assertEqual(aa.tenant, 'UDS_LOCAL', f'wrong tenant')
2828
print(aa)
29+
30+
granule_id = 'URN:NASA:UNITY:unity:test:TRPSDL2ALLCRS1MGLOS___2:TROPESS_CrIS-JPSS1_L2_Standard_H2O_20250108_MUSES_R1p23_megacity_los_angeles_MGLOS_F2p5_J0'
31+
aa = UdsCollections.decode_granule_identifier(granule_id)
32+
self.assertEqual(aa.venue, 'test', f'wrong venue')
33+
self.assertEqual(aa.tenant, 'unity', f'wrong tenant')
34+
self.assertEqual(aa.granule, 'TROPESS_CrIS-JPSS1_L2_Standard_H2O_20250108_MUSES_R1p23_megacity_los_angeles_MGLOS_F2p5_J0')
35+
print(aa)
36+
granule_id = 'URN:NASA:UNITY:unity:test:TRPSDL2ALLCRS1MGLOS___2:TROPESS_CrIS-JPSS1_L2_Standard_H2O_20250108_MUSES_R1p23_megacity_los_angeles_MGLOS_F2p5_J0:1:2:3:4'
37+
aa = UdsCollections.decode_granule_identifier(granule_id)
38+
self.assertEqual(aa.venue, 'test', f'wrong venue')
39+
self.assertEqual(aa.tenant, 'unity', f'wrong tenant')
40+
self.assertEqual(aa.granule, 'TROPESS_CrIS-JPSS1_L2_Standard_H2O_20250108_MUSES_R1p23_megacity_los_angeles_MGLOS_F2p5_J0:1:2:3:4')
41+
2942
return
3043

0 commit comments

Comments
 (0)