stac-utils / stac-utils/rustac-py

DuckDB queries into structures aren't escaped correctly

Open
#170 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
54
Forks
5
Avg merge
32m
Merged PRs (30d)
1

Description

I'm trying to find all the items that contain a specific variable name, like "hurs".

The item with the "hurs" variable looks like this:

Image

and I know that WHERE "cube:variables".hurs IS NOT NULL works.

But what should the filter argument for rustac look like?

cql_json_filter = {
    "op": "is_not_null",
    "args": [
        {"property": "cube:variables.hurs"}
    ]
}
items = await rustac.search('stac_items.parquet', filter=cql_json_filter)

doesn't error, but doesn't return my item either.

I pretty sure this is some simple user syntax error, here, right?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the rustac.search filter handling for stac_items.parquet and trace how the CQL JSON property cube:variables.hurs is passed to the DuckDB query. Check the existing filter-related tests or add a focused case for a non-null nested structure property. Done means the query returns the item containing hurs without breaking other structure filters.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.