Skip to content

Conversation

glostis
Copy link
Contributor

@glostis glostis commented May 6, 2019

According to the API documentation (https://developers.planet.com/docs/data/reference/#tag/Item-Search), it is possible to pass a strict argument to QuickSearches and SavedSearches.

This didn't seem to be implemented in the Python client, so I have added it.

I expect the user to pass in a call such as:

result = client.quick_search(request, strict=True)

with a Python boolean as the value for the keyword argument.

I do not know what low-level request-handling library you are using, but it seems that it does not automatically encode the params dict into a JSON string (for example, the library requests does that for you, if you call requests.post with a json keyword argument (documentation here).

In order to get around this problem, I json.dumps the value given, such that if you call _params(strict=True), it returns {"strict": "true"}.

@glostis
Copy link
Contributor Author

glostis commented Jan 22, 2020

I've rebased my branch on top of master.

Is there any chance someone could review this PR?

@sarasafavi
Copy link
Contributor

@glostis much belated thanks for this! LGTM... will go out in the next release.

@sarasafavi sarasafavi merged commit a957ad2 into planetlabs:master Jan 23, 2020
@glostis glostis deleted the add_strict_kw branch January 24, 2020 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants