-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Das 2192 #14
Das 2192 #14
Conversation
… SMAP L3/L4 collections
… SMAP L3/L4 collections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change makes sense. The two main things are adding a couple of quick subtests to make sure the functionality works as expected and making sure the pre-commit checks are passing. There are instructions here to set up pre-commit
for the repository.
@@ -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, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a new unit test (or more likely a sub test) here to make sure the empty list is correctly identified in this check. Probably also a sub test with a non-empty list, too, just to be sure.
Here's the test for this function. I think the easiest thing is to just add two new subtests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are several subtests with non empty list. But I added 2 subtests for the empty and non empty list cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, looking in more detail, I think you are right about the non-empty list. But thanks for adding a couple of unit tests.
CHANGELOG.md
Outdated
## 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super pedantic nit: The single-quotes around the is_index_subset
should probably be backticks so that the function renders as code in the markdown.
CHANGELOG.md
Outdated
### 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 prefetch from being called for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other nit: This line is missing a closing parenthesis. I think it's meant to be:
as well as
None
(for spatial, bounding box and temporal subsets). This prevents prefetch from being called for
I guess one other note: I don't know that "prefetch" is too informative for a lot of folks. Maybe:
This prevents 1-D dimension variables from being unnecessarily requested from OPeNDAP for some variable subsets, in particular SMAP L3 and L4 collections.
Nit on line below: "occuring" -> "occurring".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the unit test. That looks good.
I think all I have left are the nits from CHANGELOG.md
(missing closing parenthesis and adding a bit more context to the prose about the prefetch request to OPeNDAP). Other than that, I found one more nit about the description of the new unit test. Otherwise, this is looking good.
For what it's worth, the reason I'm being a bit pedantic about the CHANGELOG.md
is it forms the basis of the public release notes for 1.0.5 release, which are are pretty public-facing, so it's good to make sure there's not typos in them etc.
@@ -679,6 +679,38 @@ def test_is_index_subset(self): | |||
) | |||
) | |||
|
|||
with self.subTest('No index Subset'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I think it's probably worth explicitly stating this subtest is for an empty dimensions
list rather than "No index subset".
@@ -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, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, looking in more detail, I think you are right about the non-empty list. But thanks for adding a couple of unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change + the unit test updates look good and cover the necessary updates. Good work!
Thanks @autydp |
Thanks @owenlittlejohns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments I had.
When merging please use the "Squash and Merge" option, and be sure to prepend the squashed commit message with the ticket number, so something like "DAS-2192 - Ensure HOSS correctly identifies when an index range subset is necessary". (The commits so far in this PR do not do this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I was following along in the background.
"DAS-2192 - Ensure HOSS correctly identifies when an index range subset is necessary". |
Description
Prefetch of dimension variables was occurring for variable subsetting for SMAP L3/L4 collections. The update to the is_index_subset method fixes the bug.
Jira Issue ID
DAS-2192
Local Test Steps. At least one of the urls can be tested. The full test can be done post merge.
http://localhost:3000/C1268452378-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268452388-EEDTEST&variable=Soil_Moisture_Retrieval_Data_AM%2Falbedo&skipPreview=true
http://localhost:3000/C1268399578-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268399648-EEDTEST&variable=Soil_Moisture_Retrieval_Data_AM%2Falbedo&skipPreview=true
http://localhost:3000/C1268617120-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268617167-EEDTEST&variable=Freeze_Thaw_Retrieval_Data_Global%2Faltitude_dem&skipPreview=true
http://localhost:3000/C1268616149-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268616387-EEDTEST&variable=Freeze_Thaw_Retrieval_Data_Global%2Faltitude_dem&skipPreview=true
http://localhost:3000/C1268612485-EEDTEST/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?forceAsync=true&granuleId=G1268612495-EEDTEST&skipPreview=true
http://localhost:3000/C1268612473-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268612483-EEDTEST&variable=Soil_Moisture_Retrieval_Data%2Falbedo&skipPreview=true
http://localhost:3000/C1268429762-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268612499-EEDTEST&variable=a%2FLogFileName%2CSoil_Moisture_Retrieval_Data_1km%2Falbedo_1km&skipPreview=true
http://localhost:3000/C1268429762-EEDTEST/ogc-api-coverages/1.0.0/collections/parameter_vars/coverage/rangeset?forceAsync=true&granuleId=G1268612499-EEDTEST&variable=a%2FLogFileName%2CSoil_Moisture_Retrieval_Data_1km%2Falbedo_1km&skipPreview=true
PR Acceptance Checklist
CHANGELOG.md
updated to include high level summary of PR changes.docker/service_version.txt
updated if publishing a release.The fix does only corrects variable subsetting. Spatial subsetting will be fixed in DAS-2232 after a fix to varinfo in DAS-2231
The jupyter notebook tests will be updated after the fix to DAS-2231 and DAS-2232 and the corresponding HOSS changes