Skip to content

feat: Implement ST_ISCLOSED geography function#1789

Merged
tswast merged 11 commits intomainfrom
add-st-isclosed-geography-function
Jun 9, 2025
Merged

feat: Implement ST_ISCLOSED geography function#1789
tswast merged 11 commits intomainfrom
add-st-isclosed-geography-function

Conversation

@tswast
Copy link
Collaborator

@tswast tswast commented Jun 3, 2025

This commit implements the ST_ISCLOSED geography function.

The following changes were made:

  • Added GeoIsClosedOp to bigframes/operations/geo_ops.py.
  • Added st_isclosed function to bigframes/bigquery/_operations/geo.py.
  • Added is_closed property to GeoSeries in bigframes/geopandas/geoseries.py.
  • Added system tests for the is_closed property.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

This commit implements the `ST_ISCLOSED` geography function.

The following changes were made:
- Added `GeoIsClosedOp` to `bigframes/operations/geo_ops.py`.
- Added `st_isclosed` function to `bigframes/bigquery/_operations/geo.py`.
- Added `is_closed` property to `GeoSeries` in `bigframes/geopandas/geoseries.py`.
- Added system tests for the `is_closed` property.
@tswast tswast requested review from a team as code owners June 3, 2025 22:15
@tswast tswast requested a review from shobsi June 3, 2025 22:15
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Jun 3, 2025
tswast and others added 4 commits June 4, 2025 10:38
This commit implements the `ST_ISCLOSED` geography function.

The following changes were made:
- Added `GeoIsClosedOp` to `bigframes/operations/geo_ops.py`.
- Added `st_isclosed` function to `bigframes/bigquery/_operations/geo.py`.
- Added `is_closed` property to `GeoSeries` in `bigframes/geopandas/geoseries.py`.
- Registered `GeoIsClosedOp` in `bigframes/core/compile/scalar_op_compiler.py`
  by defining an Ibis UDF and registering the op.
- Added system checks for the `is_closed` property.
@tswast
Copy link
Collaborator Author

tswast commented Jun 4, 2025

@shobsi I believe this is now ready for review. I addressed the failing system tests and moved the docstring to the correct location in third_party.

@tswast
Copy link
Collaborator Author

tswast commented Jun 4, 2025

e2e failure FAILED tests/system/small/operations/test_strings.py::test_isdigit - Assertio.. is a known issue b/333484335

@GarrettWu GarrettWu removed their assignment Jun 4, 2025
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Jun 6, 2025
@tswast
Copy link
Collaborator Author

tswast commented Jun 6, 2025

doctest failures appear unrelated:

FAILED third_party/bigframes_vendored/pandas/core/strings/accessor.py::accessor.StringMethods.lstrip
FAILED third_party/bigframes_vendored/pandas/core/strings/accessor.py::accessor.StringMethods.rstrip
FAILED third_party/bigframes_vendored/pandas/core/strings/accessor.py::accessor.StringMethods.strip
=========== 3 failed, 668 passed, 80 warnings in 1624.34s (0:27:04) ============

I believe this relates to the latest pandas update. Filed b/422994327 to fix.

@tswast tswast requested a review from shobsi June 6, 2025 19:40
shobsi
shobsi previously approved these changes Jun 9, 2025
@tswast
Copy link
Collaborator Author

tswast commented Jun 9, 2025

TODO:

@tswast tswast merged commit 36bc179 into main Jun 9, 2025
22 of 24 checks passed
@tswast tswast deleted the add-st-isclosed-geography-function branch June 9, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants