Skip to content

Commit

Permalink
"DAS-2192 - Ensure HOSS correctly identifies when an index range subs…
Browse files Browse the repository at this point in the history
…et is necessary".

* updates to prevent prefetch from being called for variable subset for SMAP L3/L4 collections

* updates to prevent prefetch from being called for variable subset for SMAP L3/L4 collections

* added couple of unit tests to is_index_subset function to test empty lists

* updates based on PR feedback

* updated CHANGELOG.md again
  • Loading branch information
sudha-murthy committed Aug 22, 2024
1 parent c46071a commit 065415e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@

## v1.0.5
### 2024-08-19

This version of HOSS updates the `is_index_subset` method to check for empty list (in case of dimensions subset)
as well as None (for the spatial, bbox and temporal subsets). This prevents 1-D dimension variables from being
unnecessarily requested from OPeNDAP for variable subsets which needs to be done only for spatial and temporal
subsetting requests. This also prevents a whole granule request when 1-D dimension variables were not present
in the granule.

## v1.0.4
### 2024-04-05

Expand Down
2 changes: 1 addition & 1 deletion docker/service_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5
2 changes: 1 addition & 1 deletion hoss/dimension_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def is_index_subset(message: Message) -> bool:
"""
return any(
rgetattr(message, subset_parameter, None) is not None
rgetattr(message, subset_parameter, None) not in (None, [])
for subset_parameter in [
'subset.bbox',
'subset.shape',
Expand Down
32 changes: 32 additions & 0 deletions tests/unit/test_dimension_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,38 @@ def test_is_index_subset(self):
)
)

with self.subTest('Empty dimensions List'):
self.assertFalse(
is_index_subset(
Message(
{
'subset': {
'bbox': None,
'shape_file': None,
'dimensions': [],
},
'temporal': None,
}
)
)
)

with self.subTest('Dimensions Subset is not empty'):
self.assertTrue(
is_index_subset(
Message(
{
'subset': {
'bbox': None,
'shape_file': None,
'dimensions': dimensions,
},
'temporal': None,
}
)
)
)

with self.subTest('Not an index range subset'):
self.assertFalse(is_index_subset(Message({})))

Expand Down

0 comments on commit 065415e

Please sign in to comment.