Skip to content

Commit 5b42034

Browse files
committed
test(sqlalchemy-bigquery): wrap coordinate in WKT(...) in test_geoalchemy2_core unit test
1 parent 226c787 commit 5b42034

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/sqlalchemy-bigquery/tests/unit/test_geography.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_geoalchemy2_core(faux_conn, last_query):
3232

3333
from sqlalchemy import Column, String
3434

35-
from sqlalchemy_bigquery import GEOGRAPHY
35+
from sqlalchemy_bigquery import GEOGRAPHY, WKT
3636

3737
lake_table = setup_table(
3838
conn, "lake", Column("name", String), Column("geog", GEOGRAPHY)
@@ -91,16 +91,16 @@ def test_geoalchemy2_core(faux_conn, last_query):
9191
try:
9292
conn.execute(
9393
select(lake_table.c.name).where(
94-
func.ST_Contains(lake_table.c.geog, "POINT(4 1)")
94+
func.ST_Contains(lake_table.c.geog, WKT("POINT(4 1)"))
9595
)
9696
)
9797
except Exception:
9898
pass # sqlite had no special functions :)
9999
last_query(
100100
"SELECT `lake`.`name` \n"
101101
"FROM `lake` \n"
102-
"WHERE ST_Contains(`lake`.`geog`, %(ST_Contains_1:STRING)s)",
103-
{"ST_Contains_1": "POINT(4 1)"},
102+
"WHERE ST_Contains(`lake`.`geog`, ST_GeogFromText(%(ST_GeogFromText_1:STRING)s))",
103+
{"ST_GeogFromText_1": "POINT(4 1)"},
104104
)
105105

106106
try:

0 commit comments

Comments
 (0)