Skip to content

[GH-3344] GeoPandas: expose valid spatial index predicates - #3345

Merged
jiayuasu merged 2 commits into
apache:masterfrom
jiayuasu:feature/spatial-index-predicates
Sep 11, 2026
Merged

[GH-3344] GeoPandas: expose valid spatial index predicates#3345
jiayuasu merged 2 commits into
apache:masterfrom
jiayuasu:feature/spatial-index-predicates

Conversation

@jiayuasu

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Yes, I have read the Contributor Rules and Contributor Development Guide.

Is this PR related to a ticket?

Yes, the PR name follows the format [GH-XXX] my subject.

Closes #3344. Part of #2230.

What changes were proposed in this PR?

Add the read-only SpatialIndex.valid_query_predicates property. It returns a fresh set containing None, "intersects", and "contains", using the same supported-predicate list as query().

This only exposes the accepted predicate values. It does not add predicates or change query execution.

How was this patch tested?

From the python directory:

python -m pytest tests/geopandas/test_sindex.py -q --disable-warnings
  • Spark 3.5.4: 21 passed.
  • Spark 4.1.1: 21 passed.
  • The four new parameterized cases failed with the missing-property AttributeError before implementation. They cover querying with every advertised predicate on local and Spark-backed indexes, empty indexes, and isolation of the returned set.
  • Repository formatting and lint hooks passed for both changed files.

Did this PR include necessary documentation updates?

Yes, this adds a public API. Its docstring documents the returned predicates and the default behavior, with versionadded:: 2.0.0 for the current v2.0.0 development release.

@jiayuasu jiayuasu added this to the sedona-2.0.0 milestone Sep 11, 2026
@jiayuasu
jiayuasu merged commit cfac518 into apache:master Sep 11, 2026
33 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.

GeoPandas: expose SpatialIndex.valid_query_predicates

1 participant