Skip to content

Commit 4878076

Browse files
committed
refactor: fix test_geo_x_non_point and test_geo_drop_duplicates
1 parent 3ab4b5c commit 4878076

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bigframes/core/compile/sqlglot/aggregations/windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _compile_group_by_key(key: ex.Expression) -> sge.Expression:
174174
if key.dtype == dtypes.FLOAT_DTYPE:
175175
expr = sge.Cast(this=expr, to="STRING")
176176
elif key.dtype == dtypes.GEO_DTYPE:
177-
expr = sge.Cast(this=expr, to="BYTES")
177+
expr = sge.func("ST_ASBINARY", expr)
178178
elif key.dtype == dtypes.JSON_DTYPE:
179179
expr = sge.func("TO_JSON_STRING", expr)
180180
return expr

tests/unit/core/compile/sqlglot/aggregations/test_windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_apply_window_if_present_grouping_no_ordering(self):
114114
)
115115
self.assertEqual(
116116
result.sql(dialect="bigquery"),
117-
"value OVER (PARTITION BY `col1`, CAST(`col2` AS STRING), TO_JSON_STRING(`col3`), CAST(`col4` AS BYTES))",
117+
"value OVER (PARTITION BY `col1`, CAST(`col2` AS STRING), TO_JSON_STRING(`col3`), ST_ASBINARY(`col4`))",
118118
)
119119

120120
def test_apply_window_if_present_range_bounded(self):

0 commit comments

Comments
 (0)