Skip to content

Commit bef977f

Browse files
committed
fix(sqlalchemy-bigquery): fix dataset scoping and metadata declaration in system geography tests
1 parent dc15fd0 commit bef977f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_geoalchemy2_core(engine, bigquery_dataset):
3838

3939
from sqlalchemy_bigquery import GEOGRAPHY, WKT
4040

41+
metadata = MetaData()
4142
lake_table = Table(
4243
"lake", metadata, Column("name", String), Column("geog", GEOGRAPHY)
4344
)
@@ -128,12 +129,16 @@ def test_geoalchemy2_core(engine, bigquery_dataset):
128129
)
129130

130131

131-
def test_geoalchemy2_orm(engine, bigquery_dataset):
132+
def test_geoalchemy2_orm(bigquery_dataset):
132133
"""Make sure GeoAlchemy 2 ORM Tutorial works as adapted to only having geometry
133134
134135
https://geoalchemy-2.readthedocs.io/en/latest/orm_tutorial.html
135136
"""
136137

138+
from sqlalchemy import create_engine
139+
140+
engine = create_engine(f"bigquery:///{bigquery_dataset}")
141+
137142
# Declare a Mapping
138143

139144
from sqlalchemy import Column, Integer, String
@@ -237,7 +242,10 @@ class Lake(Base):
237242
]
238243

239244

240-
def test_geoalchemy2_orm_w_relationship(engine, bigquery_dataset):
245+
def test_geoalchemy2_orm_w_relationship(bigquery_dataset):
246+
from sqlalchemy import create_engine
247+
248+
engine = create_engine(f"bigquery:///{bigquery_dataset}")
241249

242250
from sqlalchemy import Column, Integer, String
243251
from sqlalchemy.ext.declarative import declarative_base

0 commit comments

Comments
 (0)