Skip to content

Implement neq query operator#364

Merged
vincentsarago merged 5 commits intostac-utils:mainfrom
mcucchi9:feature/neq-query-operator
Mar 26, 2026
Merged

Implement neq query operator#364
vincentsarago merged 5 commits intostac-utils:mainfrom
mcucchi9:feature/neq-query-operator

Conversation

@mcucchi9
Copy link
Copy Markdown
Contributor

@mcucchi9 mcucchi9 commented Mar 12, 2026

Related Issue(s):

Description:

This PR does two things:

  1. Simplify the Operator class in the extensions/query.py module by removing the unused operator method and unnecessary dependencies.
  2. Implement the STAC API standard neq query operator, leveraging the neq pgstac opeator, and add related test.

Closes #363

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

NOTE: tests have been run only for pgstac=0.9.9, as per #346.

@vincentsarago vincentsarago requested review from bitner and hrodmn March 25, 2026 12:53
Copy link
Copy Markdown
Collaborator

@bitner bitner left a comment

Choose a reason for hiding this comment

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

This is fine, but I will note that this only works because pgstac tries to be very permissive on operators that it accepts, so it will take "ne", "neq", "<>", and "!=" to be the same thing in either a query, cql1 or cql2. This is technically incorrect, but we have decided it is better to be lax in what we accept.

Officially, pgstac only really tries to support CQL2 json and makes a good faith effort to support the query extension (which while not deprecated - for a while it actually was marked as deprecated, but it seems to have risen from the dead - does recommend people to switch to the filter extension with CQL2). It does this by trying to convert query or CQL1 into CQL2, but these transformations are far from fully tested in our unit tests.

It is highly recommended that people shift away from the query extension and from using CQL1 towards CQL2. At some point in the future it is likely that we will deprecate and cease support in pgstac for these.

@vincentsarago vincentsarago merged commit cdeb03d into stac-utils:main Mar 26, 2026
6 checks passed
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.

Query extension: standard neq operator is missing

3 participants