Skip to content
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

Allow providing filter-lang to search #128

Merged
merged 3 commits into from
Jan 4, 2022

Conversation

mmcfarland
Copy link
Contributor

@mmcfarland mmcfarland commented Jan 4, 2022

Description:

The user can optionally provide a filter-lang parameter to the
ItemSearch endpoint when using filter. This preserves the existing
behavior of defaulting to cql-json when no value is provided, so it
should be backwards compatible with existing code. By optionally
providing a new value, such as cql2-json, the user can supply filters
with different JSON language variants.

This change minimally anticipates the forthcoming STAC-API beta release
of the filter fragment while preserving existing behavior. After the CQL2
changes are released in the next beta, it's likely we'll need a larger refactor
around supporting cql2-text, new conformance classes, etc. In the meantime,
this change will allow Planetary Computer users run cql2-json filters which are
supported in our pgstac implementation.

PR Checklist:

  • Code is formatted
  • Tests pass
  • Changes are added to the CHANGELOG

The user can optionally provide a filter-lang parameter to the
ItemSearch endpoint when using filter. This preserves the existing
behavior of defaulting to `cql-json` when no value is provided, so it
should be backwards compatible with existing code. By optionally
providing a new value, such as `cql2-json`, the user can supply filters
with different JSON language variants.
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2022

Codecov Report

Merging #128 (2e24e62) into main (69d48e2) will increase coverage by 0.71%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
+ Coverage   80.32%   81.04%   +0.71%     
==========================================
  Files           9        9              
  Lines         549      554       +5     
==========================================
+ Hits          441      449       +8     
+ Misses        108      105       -3     
Impacted Files Coverage Δ
pystac_client/item_search.py 88.33% <100.00%> (+1.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69d48e2...2e24e62. Read the comment docs.

@matthewhanson matthewhanson merged commit 06ef534 into stac-utils:main Jan 4, 2022
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.

3 participants