-
Notifications
You must be signed in to change notification settings - Fork 96
Remove filter requirement for data quick search, planet data filter cli command outputs empty filter by default #842
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
Conversation
@julee could you look at content changes? |
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 great, works great in my limited testing.
I think the only thing in here that will be subtly confusing, especially in evolution from the current thing, is that:
planet data filter --number-in cloud_percent 4 | planet data search PSScene
won't actually get the filter applied. You need to remember to add --filter -
. If you've got any ideas on how to nudge people towards that it could be good. Like can we detect if they're attempting to pipe something and warn them that it won't be applied?
@cholmes hmm... yeah, that's a hard one to protect against. There is the option of prompting the user for confirmation (overridden with an |
Could it just raise a little warning when searching without a filter? Even better would be if we could detect if there's anything being piped in. Like if it detects some attempted pipe then it would raise that message (or an even stronger warning, since it wouldn't come up every time) |
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.
Everything looks good to me! I can confirm that all tests pass on 3.10 and 3.11.
@cholmes I don't know of a way to check for an attempt to pipe in. Or, if there is a way, it would take a lot of work. I'm also not sure of how to output a warning that wouldn't mess up any further processing of the search results - like if we pipe it to jq then jq will probably croak on the warning message before it can process the results that are the actual outputs. |
Ah, I had been thinking that a warning maybe wouldn't go to stdout in the same way, but you're probably right. Ok, sounds like no easy solution - seems like we should just ship it and be sure to document it all well. Maybe a note / warning somewhere in the docs, and in the release notes, to notify people to watch out for piping without the '-'. New users shouldn't have any trouble with it, and we only have a small number of users today, so it should be fine. |
Related Issue(s):
Closes #600 #704 #637
Proposed Changes:
For inclusion in changelog (if applicable):
--filter
for the CLI andsearch_filter
for the API.--permissions
and--std-quality
flagsNot intended for changelog:
Diff of User Interface
Planet data filter
Old behavior:
planet data filter
outputs a permissions and standard quality filter by defaultto get an empty filter use
New behavior:
planet data filter
outputs an empty filter by defaultto get a permissions/std-quality filter:
Planet quick search, CLI
Old behavior:
planet data search PSScene filter.json
applies filter to search, returns at most 100 resultsplanet data search PSScene
errors out due to FILTER being a required argumentNew behavior:
planet data search PSScene -filter filter.json
applies filter to searchplanet data search PSScene
returns 100 (default value of limit) resultsPlanet quick search, API
Old behavior:
applies filter to search
Errors out due to search_filter being a required argument
New behavior:
applies filter to search
Returns 100 (default value of limit) results
PR Checklist:
(Optional) @mentions for Notifications:
@cholmes @JuLeeAtPlanet