Copilot commented on code in PR #2099:
URL: https://github.com/apache/sedona/pull/2099#discussion_r2207916956
##########
python/sedona/geopandas/sindex.py:
##########
@@ -90,18 +90,28 @@ def query(self, geometry, predicate=None, sort=False):
if self.is_empty:
return []
+ # Validate predicate value
+ if predicate is not None and predicate not in ["intersects",
"contains"]:
+ raise ValueError(
+ f"Predicate must be either 'intersects' or 'contains', got
'{predicate}'"
Review Comment:
[nitpick] Consider extracting the supported predicates into a module-level
constant (e.g., ALLOWED_PREDICATES) to avoid duplicating literal lists and
improve readability.
```suggestion
if predicate is not None and predicate not in ALLOWED_PREDICATES:
raise ValueError(
f"Predicate must be one of {ALLOWED_PREDICATES}, got
'{predicate}'"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]