sqlalchemy-bigquery 1.17.0__tar.gz → 1.17.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlalchemy_bigquery-1.17.0/sqlalchemy_bigquery.egg-info → sqlalchemy_bigquery-1.17.1}/PKG-INFO +8 -8
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/setup.py +1 -1
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/geography.py +2 -3
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/version.py +1 -1
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1/sqlalchemy_bigquery.egg-info}/PKG-INFO +8 -8
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_geography.py +6 -8
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_sqlalchemy_bigquery.py +8 -6
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_engine.py +6 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_geography.py +33 -5
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/AUTHORS +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/LICENSE +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/MANIFEST.in +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/README.rst +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/pyproject.toml +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/setup.cfg +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/_helpers.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/_struct.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/_types.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/base.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/parse_url.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/requirements.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/SOURCES.txt +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/dependency_links.txt +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/entry_points.txt +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/requires.txt +5 -5
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/top_level.txt +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/conftest.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/sqlalchemy_dialect_compliance/README.rst +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/sqlalchemy_dialect_compliance/conftest.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/conftest.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/sample.json +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/sample_one_row.json +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/schema.json +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test__struct.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_alembic.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_helpers.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_sqlalchemy_bigquery_remote.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/conftest.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/fauxdbi.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test__struct.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test__types.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_alembic.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_catalog_functions.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_comments.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_compiler.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_compliance.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_dialect_types.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_helpers.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_like_reescape.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_parse_url.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_select.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_sqlalchemy_bigquery.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_table_options.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_version.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_view.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/py.typed +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/AUTHORS +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/LICENSE +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/__init__.py +0 -0
- {sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py +0 -0
{sqlalchemy_bigquery-1.17.0/sqlalchemy_bigquery.egg-info → sqlalchemy_bigquery-1.17.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlalchemy-bigquery
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.1
|
|
4
4
|
Summary: SQLAlchemy dialect for BigQuery
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/sqlalchemy-bigquery
|
|
6
6
|
Author: The Sqlalchemy-Bigquery Authors
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
20
20
|
Classifier: Operating System :: OS Independent
|
|
21
21
|
Classifier: Topic :: Database :: Front-Ends
|
|
22
22
|
Obsoletes: pybigquery
|
|
23
|
-
Requires-Python: >=3.10
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
24
|
Description-Content-Type: text/x-rst
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
License-File: AUTHORS
|
|
@@ -44,16 +44,16 @@ Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "bqs
|
|
|
44
44
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "bqstorage"
|
|
45
45
|
Requires-Dist: pyarrow>=6.0.0; extra == "bqstorage"
|
|
46
46
|
Provides-Extra: all
|
|
47
|
-
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "all"
|
|
48
47
|
Requires-Dist: GeoAlchemy2; extra == "all"
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist: pytz; extra == "all"
|
|
51
|
-
Requires-Dist: alembic; extra == "all"
|
|
48
|
+
Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "all"
|
|
52
49
|
Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "all"
|
|
53
|
-
Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
|
|
54
50
|
Requires-Dist: shapely; extra == "all"
|
|
55
|
-
Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "all"
|
|
56
51
|
Requires-Dist: pyarrow>=6.0.0; extra == "all"
|
|
52
|
+
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "all"
|
|
53
|
+
Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
|
|
54
|
+
Requires-Dist: pytz; extra == "all"
|
|
55
|
+
Requires-Dist: alembic; extra == "all"
|
|
56
|
+
Requires-Dist: packaging; extra == "all"
|
|
57
57
|
Dynamic: author
|
|
58
58
|
Dynamic: author-email
|
|
59
59
|
Dynamic: classifier
|
|
@@ -121,7 +121,7 @@ setup(
|
|
|
121
121
|
"sqlalchemy>=1.4.16,<3.0.0",
|
|
122
122
|
],
|
|
123
123
|
extras_require=extras,
|
|
124
|
-
python_requires=">=3.10
|
|
124
|
+
python_requires=">=3.10",
|
|
125
125
|
tests_require=["packaging", "pytz"],
|
|
126
126
|
entry_points={
|
|
127
127
|
"sqlalchemy.dialects": ["bigquery = sqlalchemy_bigquery:BigQueryDialect"]
|
|
@@ -183,9 +183,8 @@ def _fixup_st_arguments(element, compiler, **kw):
|
|
|
183
183
|
argument_types = _argument_types.get(element.name.lower())
|
|
184
184
|
if argument_types:
|
|
185
185
|
for argument_type, argument in zip(argument_types, element.clauses.clauses):
|
|
186
|
-
if isinstance(argument, BindParameter) and (
|
|
187
|
-
argument.type
|
|
188
|
-
or not isinstance(argument.type, argument_type)
|
|
186
|
+
if isinstance(argument, BindParameter) and not isinstance(
|
|
187
|
+
argument.type, argument_type
|
|
189
188
|
):
|
|
190
189
|
argument.type = argument_type()
|
|
191
190
|
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1/sqlalchemy_bigquery.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlalchemy-bigquery
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.1
|
|
4
4
|
Summary: SQLAlchemy dialect for BigQuery
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/sqlalchemy-bigquery
|
|
6
6
|
Author: The Sqlalchemy-Bigquery Authors
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
20
20
|
Classifier: Operating System :: OS Independent
|
|
21
21
|
Classifier: Topic :: Database :: Front-Ends
|
|
22
22
|
Obsoletes: pybigquery
|
|
23
|
-
Requires-Python: >=3.10
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
24
|
Description-Content-Type: text/x-rst
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
License-File: AUTHORS
|
|
@@ -44,16 +44,16 @@ Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "bqs
|
|
|
44
44
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "bqstorage"
|
|
45
45
|
Requires-Dist: pyarrow>=6.0.0; extra == "bqstorage"
|
|
46
46
|
Provides-Extra: all
|
|
47
|
-
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "all"
|
|
48
47
|
Requires-Dist: GeoAlchemy2; extra == "all"
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist: pytz; extra == "all"
|
|
51
|
-
Requires-Dist: alembic; extra == "all"
|
|
48
|
+
Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "all"
|
|
52
49
|
Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "all"
|
|
53
|
-
Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
|
|
54
50
|
Requires-Dist: shapely; extra == "all"
|
|
55
|
-
Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "all"
|
|
56
51
|
Requires-Dist: pyarrow>=6.0.0; extra == "all"
|
|
52
|
+
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "all"
|
|
53
|
+
Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
|
|
54
|
+
Requires-Dist: pytz; extra == "all"
|
|
55
|
+
Requires-Dist: alembic; extra == "all"
|
|
56
|
+
Requires-Dist: packaging; extra == "all"
|
|
57
57
|
Dynamic: author
|
|
58
58
|
Dynamic: author-email
|
|
59
59
|
Dynamic: classifier
|
|
@@ -42,7 +42,7 @@ def test_geoalchemy2_core(bigquery_dataset):
|
|
|
42
42
|
|
|
43
43
|
from sqlalchemy import Column, MetaData, String, Table
|
|
44
44
|
|
|
45
|
-
from sqlalchemy_bigquery import GEOGRAPHY
|
|
45
|
+
from sqlalchemy_bigquery import GEOGRAPHY, WKT
|
|
46
46
|
|
|
47
47
|
metadata = MetaData()
|
|
48
48
|
lake_table = Table(
|
|
@@ -84,7 +84,7 @@ def test_geoalchemy2_core(bigquery_dataset):
|
|
|
84
84
|
|
|
85
85
|
[[result]] = conn.execute(
|
|
86
86
|
select(lake_table.c.name).where(
|
|
87
|
-
func.ST_Contains(lake_table.c.geog, "POINT(4 1)")
|
|
87
|
+
func.ST_Contains(lake_table.c.geog, WKT("POINT(4 1)"))
|
|
88
88
|
)
|
|
89
89
|
)
|
|
90
90
|
assert result == "Orta"
|
|
@@ -117,8 +117,6 @@ def test_geoalchemy2_core(bigquery_dataset):
|
|
|
117
117
|
|
|
118
118
|
# and, while we're at it, that we can insert WKTs, although we
|
|
119
119
|
# normally wouldn't want to.
|
|
120
|
-
from sqlalchemy_bigquery import WKT
|
|
121
|
-
|
|
122
120
|
conn.execute(
|
|
123
121
|
lake_table.insert().values(
|
|
124
122
|
name="test2",
|
|
@@ -156,7 +154,7 @@ def test_geoalchemy2_orm(bigquery_dataset):
|
|
|
156
154
|
from sqlalchemy import Column, Integer, String
|
|
157
155
|
from sqlalchemy.ext.declarative import declarative_base
|
|
158
156
|
|
|
159
|
-
from sqlalchemy_bigquery import GEOGRAPHY
|
|
157
|
+
from sqlalchemy_bigquery import GEOGRAPHY, WKT
|
|
160
158
|
|
|
161
159
|
Base = declarative_base()
|
|
162
160
|
|
|
@@ -220,19 +218,19 @@ def test_geoalchemy2_orm(bigquery_dataset):
|
|
|
220
218
|
|
|
221
219
|
from sqlalchemy import func
|
|
222
220
|
|
|
223
|
-
query = session.query(Lake).filter(func.ST_Contains(Lake.geog, "POINT(4 1)"))
|
|
221
|
+
query = session.query(Lake).filter(func.ST_Contains(Lake.geog, WKT("POINT(4 1)")))
|
|
224
222
|
|
|
225
223
|
assert [lake.name for lake in query] == ["Orta"]
|
|
226
224
|
|
|
227
225
|
query = (
|
|
228
226
|
session.query(Lake)
|
|
229
|
-
.filter(Lake.geog.ST_Intersects("LINESTRING(2 1,4 1)"))
|
|
227
|
+
.filter(Lake.geog.ST_Intersects(WKT("LINESTRING(2 1,4 1)")))
|
|
230
228
|
.order_by(Lake.name)
|
|
231
229
|
)
|
|
232
230
|
assert [lake.name for lake in query] == ["Garde", "Orta"]
|
|
233
231
|
|
|
234
232
|
lake = session.query(Lake).filter_by(name="Garde").one()
|
|
235
|
-
assert session.scalar(lake.geog.ST_Intersects("LINESTRING(2 1,4 1)"))
|
|
233
|
+
assert session.scalar(lake.geog.ST_Intersects(WKT("LINESTRING(2 1,4 1)")))
|
|
236
234
|
|
|
237
235
|
# Use Other Spatial Functions
|
|
238
236
|
query = session.query(Lake.name, func.ST_Area(Lake.geog).label("area")).order_by(
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_sqlalchemy_bigquery.py
RENAMED
|
@@ -481,17 +481,16 @@ def test_custom_expression(
|
|
|
481
481
|
assert len(result) > 0
|
|
482
482
|
|
|
483
483
|
|
|
484
|
-
@pytest.mark.skipif(
|
|
485
|
-
SQLALCHEMY_VERSION >= packaging.version.parse("2.0"),
|
|
486
|
-
reason="Needs to be revisited as part of ensuring full SQL 2.0 compliance.",
|
|
487
|
-
)
|
|
488
484
|
def test_compiled_query_literal_binds(
|
|
489
485
|
engine, engine_using_test_dataset, table, table_using_test_dataset, query
|
|
490
486
|
):
|
|
491
487
|
q = query(table)
|
|
492
488
|
compiled = q.compile(engine, compile_kwargs={"literal_binds": True})
|
|
493
489
|
with engine.connect() as conn:
|
|
494
|
-
|
|
490
|
+
if hasattr(conn, "exec_driver_sql"):
|
|
491
|
+
result = conn.exec_driver_sql(str(compiled)).fetchall()
|
|
492
|
+
else:
|
|
493
|
+
result = conn.execute(compiled).fetchall()
|
|
495
494
|
assert len(result) > 0
|
|
496
495
|
|
|
497
496
|
q = query(table_using_test_dataset)
|
|
@@ -499,7 +498,10 @@ def test_compiled_query_literal_binds(
|
|
|
499
498
|
engine_using_test_dataset, compile_kwargs={"literal_binds": True}
|
|
500
499
|
)
|
|
501
500
|
with engine_using_test_dataset.connect() as conn:
|
|
502
|
-
|
|
501
|
+
if hasattr(conn, "exec_driver_sql"):
|
|
502
|
+
result = conn.exec_driver_sql(str(compiled)).fetchall()
|
|
503
|
+
else:
|
|
504
|
+
result = conn.execute(compiled).fetchall()
|
|
503
505
|
assert len(result) > 0
|
|
504
506
|
|
|
505
507
|
|
|
@@ -70,3 +70,9 @@ def test_arraysize_querystring_takes_precedence_over_default(faux_conn, metadata
|
|
|
70
70
|
metadata.create_all(engine)
|
|
71
71
|
|
|
72
72
|
assert conn.connection.test_data["arraysize"] == arraysize
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def test_dbapi_deprecated():
|
|
76
|
+
from sqlalchemy_bigquery.base import BigQueryDialect
|
|
77
|
+
|
|
78
|
+
assert BigQueryDialect.dbapi() is BigQueryDialect.import_dbapi()
|
|
@@ -32,7 +32,7 @@ def test_geoalchemy2_core(faux_conn, last_query):
|
|
|
32
32
|
|
|
33
33
|
from sqlalchemy import Column, String
|
|
34
34
|
|
|
35
|
-
from sqlalchemy_bigquery import GEOGRAPHY
|
|
35
|
+
from sqlalchemy_bigquery import GEOGRAPHY, WKT
|
|
36
36
|
|
|
37
37
|
lake_table = setup_table(
|
|
38
38
|
conn, "lake", Column("name", String), Column("geog", GEOGRAPHY)
|
|
@@ -81,7 +81,7 @@ def test_geoalchemy2_core(faux_conn, last_query):
|
|
|
81
81
|
except Exception:
|
|
82
82
|
pass # sqlite had no special functions :)
|
|
83
83
|
last_query(
|
|
84
|
-
"SELECT `lake`.`name`, ST_AsBinary(`lake`.`geog`) AS `geog` \
|
|
84
|
+
"SELECT `lake`.`name`, ST_AsBinary(`lake`.`geog`) AS `geog` \nFROM `lake`"
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
# Spatial query
|
|
@@ -91,7 +91,7 @@ def test_geoalchemy2_core(faux_conn, last_query):
|
|
|
91
91
|
try:
|
|
92
92
|
conn.execute(
|
|
93
93
|
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)"))
|
|
95
95
|
)
|
|
96
96
|
)
|
|
97
97
|
except Exception:
|
|
@@ -99,8 +99,8 @@ def test_geoalchemy2_core(faux_conn, last_query):
|
|
|
99
99
|
last_query(
|
|
100
100
|
"SELECT `lake`.`name` \n"
|
|
101
101
|
"FROM `lake` \n"
|
|
102
|
-
"WHERE ST_Contains(`lake`.`geog`, %(
|
|
103
|
-
{"
|
|
102
|
+
"WHERE ST_Contains(`lake`.`geog`, ST_GeogFromText(%(ST_GeogFromText_1:STRING)s))",
|
|
103
|
+
{"ST_GeogFromText_1": "POINT(4 1)"},
|
|
104
104
|
)
|
|
105
105
|
|
|
106
106
|
try:
|
|
@@ -181,3 +181,31 @@ def test_calling_st_functions_that_dont_take_geographies(faux_conn, last_query):
|
|
|
181
181
|
" AS `ST_GeogFromText_1`",
|
|
182
182
|
dict(ST_GeogFromText_2="point(0 0)"),
|
|
183
183
|
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def test_fixup_st_arguments():
|
|
187
|
+
from geoalchemy2.functions import GenericFunction, ST_Area
|
|
188
|
+
from sqlalchemy.sql.elements import BindParameter
|
|
189
|
+
|
|
190
|
+
from sqlalchemy_bigquery.geography import GEOGRAPHY, _fixup_st_arguments
|
|
191
|
+
|
|
192
|
+
class DummyCompiler:
|
|
193
|
+
def visit_function(self, element, **kw):
|
|
194
|
+
return "func(param)"
|
|
195
|
+
|
|
196
|
+
# Case 1: argument.type is not yet GEOGRAPHY
|
|
197
|
+
func_element = ST_Area(BindParameter("param", "point(0 0)"))
|
|
198
|
+
res = _fixup_st_arguments(func_element, DummyCompiler())
|
|
199
|
+
assert res == "func(param)"
|
|
200
|
+
assert isinstance(func_element.clauses.clauses[0].type, GEOGRAPHY)
|
|
201
|
+
|
|
202
|
+
# Case 2: argument.type is ALREADY GEOGRAPHY
|
|
203
|
+
func_element2 = ST_Area(BindParameter("param", "point(0 0)", type_=GEOGRAPHY()))
|
|
204
|
+
_fixup_st_arguments(func_element2, DummyCompiler())
|
|
205
|
+
|
|
206
|
+
# Case 3: function without specified argument types
|
|
207
|
+
class ST_Unknown(GenericFunction):
|
|
208
|
+
name = "ST_Unknown"
|
|
209
|
+
|
|
210
|
+
func_element3 = ST_Unknown(BindParameter("param", "point(0 0)"))
|
|
211
|
+
_fixup_st_arguments(func_element3, DummyCompiler())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/requirements.py
RENAMED
|
File without changes
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/requires.txt
RENAMED
|
@@ -9,13 +9,13 @@ alembic
|
|
|
9
9
|
|
|
10
10
|
[all]
|
|
11
11
|
GeoAlchemy2
|
|
12
|
-
packaging
|
|
13
|
-
pytz
|
|
14
|
-
alembic
|
|
15
|
-
grpcio<2.0.0,>=1.47.0
|
|
16
|
-
shapely
|
|
17
12
|
google-cloud-bigquery-storage<3.0.0,>=2.18.0
|
|
13
|
+
shapely
|
|
18
14
|
pyarrow>=6.0.0
|
|
15
|
+
grpcio<2.0.0,>=1.47.0
|
|
16
|
+
pytz
|
|
17
|
+
alembic
|
|
18
|
+
packaging
|
|
19
19
|
|
|
20
20
|
[all:python_version == "3.11"]
|
|
21
21
|
grpcio<2.0.0,>=1.49.1
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/sample_one_row.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_catalog_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlalchemy_bigquery-1.17.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_sqlalchemy_bigquery.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|