Skip to content

Conversation

@kurtmckee
Copy link
Contributor

@kurtmckee kurtmckee commented Aug 22, 2024

Related Issue(s):

Description:

This is a break/fix PR. The first commit adds a suite of tests that document correct LIKE-to-wildcard query value conversions, and then fixes the cql2_like_to_es() code to correctly process escaped backslashes.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
    (make test fails because the Docker container port ranges don't match, but CI, which doesn't use make test, passes)
  • Documentation has been updated to reflect changes, if applicable
    n/a, no docs in repo
  • Changes are added to the changelog

@kurtmckee kurtmckee changed the title Fix cql2_like_to_es() Make cql2_like_to_es() understand escaped backslashes Aug 22, 2024
@jamesfisher-geo
Copy link
Collaborator

Hi @kurtmckee. Thanks for the PR. After opening a PR you should add a reference to the PR in the changelog here.

There have not been any changes since the 3.0.0 release, so you should add an "Unreleased" section to the top of the list like so.

## [Unreleased]

### Changed
- <description> [#286](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/286)

@jamesfisher-geo
Copy link
Collaborator

You can find the current API tests for LIKE search in the filter extension tests: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/blob/main/stac_fastapi/tests/extensions/test_filter.py#L260-L353

In terms of filter documentation, there is none in this repo. But a list of the supported methods would be useful I'm sure. Plus a pointer to the examples and filter extension documentation, which has a lot of great examples too.

@kurtmckee
Copy link
Contributor Author

I've updated the CHANGELOG to include this change. 👍

Please let me know if anything else is missing for this PR!

@kurtmckee kurtmckee force-pushed the fix-cql2_like_to_es branch from 74d9427 to b388f35 Compare August 22, 2024 20:38
Copy link
Collaborator

@jamesfisher-geo jamesfisher-geo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks @kurtmckee!

Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work

@jonhealy1 jonhealy1 merged commit ace0c7a into stac-utils:main Aug 23, 2024
@kurtmckee kurtmckee deleted the fix-cql2_like_to_es branch August 23, 2024 13:30
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.

cql2_like_to_es() does not correctly convert

3 participants