-
Notifications
You must be signed in to change notification settings - Fork 49
feat: Implement ST_ISCLOSED geography function #1789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
@@ -41,40 +40,6 @@ def urban_areas_dfs(session, urban_areas_table_id): | |||
return (bf_ua, pd_ua) | |||
|
|||
|
|||
def test_geo_x(urban_areas_dfs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why https://jules.google.com/task moved this. Maybe to make it alphabetical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can instruct Jules to revert this file to keep the PR focused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did add some tests, so I don't mind the fix to make it alphabetical. I'll do a quick manual check to make sure we didn't lose anything in the move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. It didn't actually add any tests. Makes sense to me to revert it.
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.
@shobsi I believe this is now ready for review. I addressed the failing system tests and moved the docstring to the correct location in |
e2e failure |
False, # GEOMETRYCOLLECTION EMPTY: False | ||
None, | ||
] | ||
expected_index: pd.Index = pd.Index([0, 1, 2, 3, 4, 5, 6], dtype="Int64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] looks like expected_index is redundant here (expected_series would get that anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely unnecessary. The main reason to create it is the dtype. We use Int64
(allow null) in bigframes, but the default in pandas is int64
(no nulls).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added check_index_type=False, instead.
doctest failures appear unrelated:
I believe this relates to the latest pandas update. Filed b/422994327 to fix. |
This commit implements the
ST_ISCLOSED
geography function.The following changes were made:
GeoIsClosedOp
tobigframes/operations/geo_ops.py
.st_isclosed
function tobigframes/bigquery/_operations/geo.py
.is_closed
property toGeoSeries
inbigframes/geopandas/geoseries.py
.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:
Fixes #<issue_number_goes_here> 🦕