HARMONY-2035: As a harmony-py user, I want to request pixel subsetting.#109
Conversation
chris-durbin
left a comment
There was a problem hiding this comment.
I found setting pixel_subset='Foo' was allowed and sent the request to harmony. I'd like if we enforced that all booleans must be booleans and that we set an error message indicating that if someone tries to set it to anything other than True or False (possibly None but we'd have to make sure that works correctly and does not add the parameter to the request).
|
|
||
| def test_request_defaults_to_pixel_subset_none(): | ||
| request = Request(collection=Collection('foobar')) | ||
| assert request.pixel_subset is None No newline at end of file |
There was a problem hiding this comment.
I'd like to test that setting pixel_subset to a non-boolean value causes request.is_valid() to be False and an appropriate error message is provided.
There was a problem hiding this comment.
Added boolean parameter validations.
| params['forceAsync'] = True | ||
| # use string in lowercase as value to match how boolean values | ||
| # in params are converted below | ||
| params['forceAsync'] = 'true' |
There was a problem hiding this comment.
I'd prefer if we used booleans throughout for all boolean parameters and treat it as an error if a string or any other type is used.
We can add the boolean validations to this function:
def error_messages(self) -> List[str]:
"""A list of error messages, if any, for the request."""
There was a problem hiding this comment.
This is used to submit to Harmony which has to be a string now.
chris-durbin
left a comment
There was a problem hiding this comment.
Tested successfully, just a comment on changing the validation error message.
| ('Destination URL must be an S3 location')) | ||
| 'Destination URL must be an S3 location'), | ||
| (self.concatenate is None or isinstance(self.concatenate, bool), | ||
| 'concatenate must be either True of False'), |
There was a problem hiding this comment.
'True of False' typo in several places.
Since we are requiring a boolean type (pixel_subset='True' fails validation), we should say something like:
'concatenate must be a boolean type either True or False'
There was a problem hiding this comment.
Updated message to concatenate must be a boolean (True or False)
Jira Issue ID
HARMONY-2035
Description
This PR is the harmony-py part to support client requesting pixel subsetting. There is a corresponding harmony PR that should be used to test the harmony-py change.
It adds a new
pixel_subsetparameter in harmony-py request to support pixel subsetting.Local Test Steps
The
pixel_subsetparameter can be unset,TrueorFalsein a harmony-py request. Feel free to experiment with different values in the following tests.Use the following block to test OGC Rangeset requests:
Use the following block to test OGC EDR requests:
PR Acceptance Checklist