sqlalchemy-bigquery 1.16.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.
Files changed (68) hide show
  1. {sqlalchemy_bigquery-1.16.0/sqlalchemy_bigquery.egg-info → sqlalchemy_bigquery-1.17.1}/PKG-INFO +16 -18
  2. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/README.rst +2 -2
  3. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/setup.py +8 -9
  4. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/__init__.py +8 -12
  5. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/_helpers.py +2 -3
  6. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/_struct.py +10 -18
  7. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/_types.py +1 -2
  8. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/base.py +28 -23
  9. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/geography.py +3 -4
  10. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/version.py +1 -1
  11. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1/sqlalchemy_bigquery.egg-info}/PKG-INFO +16 -18
  12. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/SOURCES.txt +0 -1
  13. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/requires.txt +10 -10
  14. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/sqlalchemy_dialect_compliance/conftest.py +4 -3
  15. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/sqlalchemy_dialect_compliance/test_dialect_compliance.py +31 -30
  16. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/conftest.py +2 -3
  17. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test__struct.py +4 -3
  18. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_alembic.py +4 -4
  19. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_geography.py +13 -13
  20. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_sqlalchemy_bigquery.py +46 -32
  21. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_sqlalchemy_bigquery_remote.py +4 -5
  22. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/conftest.py +14 -1
  23. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test__struct.py +15 -6
  24. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_compiler.py +2 -6
  25. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_compliance.py +7 -3
  26. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_engine.py +6 -0
  27. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_geography.py +35 -6
  28. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_helpers.py +2 -1
  29. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_like_reescape.py +1 -0
  30. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_select.py +2 -0
  31. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_table_options.py +14 -2
  32. sqlalchemy_bigquery-1.16.0/sqlalchemy_bigquery/_versions_helpers.py +0 -32
  33. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/AUTHORS +0 -0
  34. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/LICENSE +0 -0
  35. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/MANIFEST.in +0 -0
  36. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/pyproject.toml +0 -0
  37. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/setup.cfg +0 -0
  38. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/parse_url.py +1 -1
  39. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery/requirements.py +1 -1
  40. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/dependency_links.txt +0 -0
  41. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/entry_points.txt +0 -0
  42. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/sqlalchemy_bigquery.egg-info/top_level.txt +0 -0
  43. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/__init__.py +0 -0
  44. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/conftest.py +0 -0
  45. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/sqlalchemy_dialect_compliance/README.rst +0 -0
  46. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/__init__.py +0 -0
  47. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/sample.json +0 -0
  48. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/sample_one_row.json +0 -0
  49. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/data/schema.json +0 -0
  50. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/system/test_helpers.py +1 -1
  51. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/__init__.py +0 -0
  52. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/fauxdbi.py +1 -1
  53. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test__types.py +1 -1
  54. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_alembic.py +0 -0
  55. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_catalog_functions.py +0 -0
  56. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_comments.py +0 -0
  57. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_dialect_types.py +0 -0
  58. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_parse_url.py +3 -3
  59. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_sqlalchemy_bigquery.py +0 -0
  60. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_version.py +0 -0
  61. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/tests/unit/test_view.py +0 -0
  62. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/__init__.py +0 -0
  63. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/py.typed +0 -0
  64. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/AUTHORS +0 -0
  65. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/LICENSE +0 -0
  66. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py +0 -0
  67. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/__init__.py +0 -0
  68. {sqlalchemy_bigquery-1.16.0 → sqlalchemy_bigquery-1.17.1}/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlalchemy-bigquery
3
- Version: 1.16.0
3
+ Version: 1.17.1
4
4
  Summary: SQLAlchemy dialect for BigQuery
5
- Home-page: https://github.com/googleapis/python-bigquery-sqlalchemy
5
+ Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/sqlalchemy-bigquery
6
6
  Author: The Sqlalchemy-Bigquery Authors
7
7
  Author-email: googleapis-packages@google.com
8
8
  Keywords: bigquery,sqlalchemy
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
15
  Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
@@ -22,13 +20,13 @@ Classifier: Programming Language :: Python :: 3.14
22
20
  Classifier: Operating System :: OS Independent
23
21
  Classifier: Topic :: Database :: Front-Ends
24
22
  Obsoletes: pybigquery
25
- Requires-Python: >=3.8, <3.15
23
+ Requires-Python: >=3.10
26
24
  Description-Content-Type: text/x-rst
27
25
  License-File: LICENSE
28
26
  License-File: AUTHORS
29
- Requires-Dist: google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0,>=1.31.5
30
- Requires-Dist: google-auth<3.0.0,>=1.25.0
31
- Requires-Dist: google-cloud-bigquery<4.0.0,>=3.3.6
27
+ Requires-Dist: google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0,>=2.11.1
28
+ Requires-Dist: google-auth<3.0.0,>=2.14.1
29
+ Requires-Dist: google-cloud-bigquery<4.0.0,>=3.20.0
32
30
  Requires-Dist: packaging
33
31
  Requires-Dist: sqlalchemy<3.0.0,>=1.4.16
34
32
  Provides-Extra: geography
@@ -40,22 +38,22 @@ Provides-Extra: tests
40
38
  Requires-Dist: packaging; extra == "tests"
41
39
  Requires-Dist: pytz; extra == "tests"
42
40
  Provides-Extra: bqstorage
43
- Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.0.0; extra == "bqstorage"
41
+ Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "bqstorage"
44
42
  Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "bqstorage"
45
43
  Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "bqstorage"
46
44
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "bqstorage"
47
- Requires-Dist: pyarrow>=5.0.0; extra == "bqstorage"
45
+ Requires-Dist: pyarrow>=6.0.0; extra == "bqstorage"
48
46
  Provides-Extra: all
49
- Requires-Dist: pytz; extra == "all"
50
- Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.0.0; extra == "all"
47
+ Requires-Dist: GeoAlchemy2; extra == "all"
48
+ Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "all"
49
+ Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "all"
51
50
  Requires-Dist: shapely; extra == "all"
51
+ Requires-Dist: pyarrow>=6.0.0; extra == "all"
52
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.49.1; python_version == "3.11" and extra == "all"
53
+ Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
54
+ Requires-Dist: pytz; extra == "all"
54
55
  Requires-Dist: alembic; extra == "all"
55
- Requires-Dist: pyarrow>=5.0.0; extra == "all"
56
- Requires-Dist: GeoAlchemy2; extra == "all"
57
56
  Requires-Dist: packaging; extra == "all"
58
- Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
59
57
  Dynamic: author
60
58
  Dynamic: author-email
61
59
  Dynamic: classifier
@@ -124,11 +122,11 @@ dependencies.
124
122
 
125
123
  Supported Python Versions
126
124
  ^^^^^^^^^^^^^^^^^^^^^^^^^
127
- Python >= 3.9, <3.14
125
+ Python >= 3.10, <= 3.14
128
126
 
129
127
  Unsupported Python Versions
130
128
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
- Python <= 3.7.
129
+ Python <= 3.9
132
130
 
133
131
 
134
132
  Mac/Linux
@@ -51,11 +51,11 @@ dependencies.
51
51
 
52
52
  Supported Python Versions
53
53
  ^^^^^^^^^^^^^^^^^^^^^^^^^
54
- Python >= 3.9, <3.14
54
+ Python >= 3.10, <= 3.14
55
55
 
56
56
  Unsupported Python Versions
57
57
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
- Python <= 3.7.
58
+ Python <= 3.9
59
59
 
60
60
 
61
61
  Mac/Linux
@@ -22,6 +22,7 @@ import io
22
22
  import itertools
23
23
  import os
24
24
  import re
25
+
25
26
  import setuptools
26
27
  from setuptools import setup
27
28
 
@@ -53,7 +54,7 @@ extras = {
53
54
  # Keep the no-op bqstorage extra for backward compatibility.
54
55
  # See: https://github.com/googleapis/python-bigquery/issues/757
55
56
  "bqstorage": [
56
- "google-cloud-bigquery-storage >= 2.0.0, <3.0.0",
57
+ "google-cloud-bigquery-storage >= 2.18.0, <3.0.0",
57
58
  # Due to an issue in pip's dependency resolver, the `grpc` extra is not
58
59
  # installed, even though `google-cloud-bigquery-storage` specifies it
59
60
  # as `google-api-core[grpc]`. We thus need to explicitly specify it here.
@@ -63,7 +64,7 @@ extras = {
63
64
  "grpcio >= 1.47.0, < 2.0.0",
64
65
  "grpcio >= 1.49.1, < 2.0.0; python_version =='3.11'",
65
66
  "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
66
- "pyarrow >= 5.0.0",
67
+ "pyarrow >= 6.0.0",
67
68
  ],
68
69
  }
69
70
 
@@ -92,7 +93,7 @@ setup(
92
93
  "sqlalchemy_bigquery_vendored": "third_party/sqlalchemy_bigquery_vendored",
93
94
  },
94
95
  packages=packages,
95
- url="https://github.com/googleapis/python-bigquery-sqlalchemy",
96
+ url="https://github.com/googleapis/google-cloud-python/tree/main/packages/sqlalchemy-bigquery",
96
97
  keywords=["bigquery", "sqlalchemy"],
97
98
  classifiers=[
98
99
  release_status,
@@ -100,8 +101,6 @@ setup(
100
101
  "License :: OSI Approved :: MIT License",
101
102
  "Programming Language :: Python",
102
103
  "Programming Language :: Python :: 3",
103
- "Programming Language :: Python :: 3.8",
104
- "Programming Language :: Python :: 3.9",
105
104
  "Programming Language :: Python :: 3.10",
106
105
  "Programming Language :: Python :: 3.11",
107
106
  "Programming Language :: Python :: 3.12",
@@ -112,17 +111,17 @@ setup(
112
111
  ],
113
112
  platforms="Posix; MacOS X; Windows",
114
113
  install_requires=[
115
- "google-api-core >= 1.31.5, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
114
+ "google-api-core >= 2.11.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
116
115
  # NOTE: Maintainers, please do not require google-auth>=2.x.x
117
116
  # Until this issue is closed
118
117
  # https://github.com/googleapis/google-cloud-python/issues/10566
119
- "google-auth>=1.25.0,<3.0.0", # Work around pip wack.
120
- "google-cloud-bigquery>=3.3.6,<4.0.0",
118
+ "google-auth>=2.14.1,<3.0.0",
119
+ "google-cloud-bigquery>=3.20.0,<4.0.0",
121
120
  "packaging",
122
121
  "sqlalchemy>=1.4.16,<3.0.0",
123
122
  ],
124
123
  extras_require=extras,
125
- python_requires=">=3.8, <3.15",
124
+ python_requires=">=3.10",
126
125
  tests_require=["packaging", "pytz"],
127
126
  entry_points={
128
127
  "sqlalchemy.dialects": ["bigquery = sqlalchemy_bigquery:BigQueryDialect"]
@@ -22,9 +22,6 @@ SQLAlchemy dialect for Google BigQuery
22
22
 
23
23
  import warnings
24
24
 
25
- from .version import __version__
26
-
27
- from .base import BigQueryDialect, dialect
28
25
  from ._types import (
29
26
  ARRAY,
30
27
  BIGNUMERIC,
@@ -44,18 +41,17 @@ from ._types import (
44
41
  TIME,
45
42
  TIMESTAMP,
46
43
  )
44
+ from .base import BigQueryDialect, dialect
45
+ from .version import __version__
46
+ import sys
47
47
 
48
- from . import _versions_helpers
49
-
50
- sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
51
-
52
- # Now that support for Python 3.7 and 3.8 has been removed, we don't expect the
48
+ # Now that support for Python 3.7, 3.8 and 3.9 has been removed, we don't expect the
53
49
  # following check to succeed. The warning is only included for robustness.
54
- if sys_major == 3 and sys_minor in (7, 8): # pragma: NO COVER
50
+ if sys.version_info < (3, 10): # pragma: NO COVER
55
51
  warnings.warn(
56
- "The python-bigquery-sqlalchemy library no longer supports Python 3.7 "
57
- "and Python 3.8. "
58
- f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
52
+ "The python-bigquery-sqlalchemy library no longer supports Python 3.7, "
53
+ "3.8 and 3.9. "
54
+ f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We "
59
55
  "recommend that you update soon to ensure ongoing support. For "
60
56
  "more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
61
57
  FutureWarning,
@@ -4,7 +4,9 @@
4
4
  # license that can be found in the LICENSE file or at
5
5
  # https://opensource.org/licenses/MIT.
6
6
 
7
+ import base64
7
8
  import functools
9
+ import json
8
10
  import re
9
11
  from typing import Optional
10
12
 
@@ -13,9 +15,6 @@ import google.auth
13
15
  from google.cloud import bigquery
14
16
  from google.oauth2 import service_account
15
17
  import sqlalchemy
16
- import base64
17
- import json
18
-
19
18
 
20
19
  USER_AGENT_TEMPLATE = "sqlalchemy/{}"
21
20
  SCOPES = (
@@ -17,18 +17,19 @@
17
17
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
18
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
19
 
20
+ from sqlalchemy.sql import operators
21
+ import sqlalchemy.sql.coercions
20
22
  import sqlalchemy.sql.default_comparator
23
+ import sqlalchemy.sql.roles
21
24
  import sqlalchemy.sql.sqltypes
22
25
  import sqlalchemy.types
23
26
 
24
- from . import base
25
-
26
- import sqlalchemy.sql.coercions
27
- import sqlalchemy.sql.roles
27
+ # from . import base # Moved to _get_subtype_col_spec to break circular import
28
28
 
29
29
 
30
30
  def _get_subtype_col_spec(type_):
31
31
  global _get_subtype_col_spec
32
+ from . import base
32
33
 
33
34
  type_compiler = base.dialect.type_compiler(base.dialect())
34
35
  _get_subtype_col_spec = type_compiler.process
@@ -90,7 +91,7 @@ class STRUCT(sqlalchemy.sql.sqltypes.Indexable, sqlalchemy.types.UserDefinedType
90
91
  subtype = self.expr.type._STRUCT_byname.get(name.lower())
91
92
  if subtype is None:
92
93
  raise KeyError(name)
93
- operator = struct_getitem_op
94
+ operator = operators.json_getitem_op
94
95
  index = _field_index(self, name, operator)
95
96
  return operator, index, subtype
96
97
 
@@ -113,16 +114,7 @@ def _field_index(self, name, operator):
113
114
  )
114
115
 
115
116
 
116
- def struct_getitem_op(a, b):
117
- raise NotImplementedError()
118
-
119
-
120
- sqlalchemy.sql.default_comparator.operator_lookup[
121
- struct_getitem_op.__name__
122
- ] = sqlalchemy.sql.default_comparator.operator_lookup["json_getitem_op"]
123
-
124
-
125
- class SQLCompiler:
126
- def visit_struct_getitem_op_binary(self, binary, operator_, **kw):
127
- left = self.process(binary.left, **kw)
128
- return f"{left}.{binary.right.value}"
117
+ # class SQLCompiler:
118
+ # def visit_json_getitem_op_binary(self, binary, operator_, **kw):
119
+ # left = self.process(binary.left, **kw)
120
+ # return f"{left}.{binary.right.value}"
@@ -17,11 +17,10 @@
17
17
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
18
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
19
 
20
+ from google.cloud.bigquery.schema import SchemaField
20
21
  import sqlalchemy.types
21
22
  import sqlalchemy.util
22
23
 
23
- from google.cloud.bigquery.schema import SchemaField
24
-
25
24
  try:
26
25
  from .geography import GEOGRAPHY
27
26
  except ImportError: # pragma: NO COVER
@@ -21,47 +21,45 @@
21
21
 
22
22
  import datetime
23
23
  from decimal import Decimal
24
- import random
25
24
  import operator
25
+ import random
26
+ import re
26
27
  import uuid
27
28
 
28
29
  from google import auth
29
30
  import google.api_core.exceptions
30
- from google.cloud.bigquery import dbapi, ConnectionProperty
31
+ from google.api_core.exceptions import NotFound
32
+ from google.cloud.bigquery import ConnectionProperty, QueryJobConfig, dbapi
31
33
  from google.cloud.bigquery.table import (
32
34
  RangePartitioning,
33
35
  TableReference,
34
36
  TimePartitioning,
35
37
  )
36
- from google.api_core.exceptions import NotFound
37
38
  import packaging.version
38
39
  import sqlalchemy
39
- import sqlalchemy.sql.expression
40
- import sqlalchemy.sql.functions
41
- import sqlalchemy.sql.sqltypes
42
- import sqlalchemy.sql.type_api
43
- from sqlalchemy.exc import NoSuchTableError, NoSuchColumnError
44
40
  from sqlalchemy import util
41
+ from sqlalchemy.engine.base import Engine
42
+ from sqlalchemy.engine.default import DefaultDialect, DefaultExecutionContext
43
+ from sqlalchemy.exc import NoSuchColumnError, NoSuchTableError
45
44
  from sqlalchemy.ext.compiler import compiles
45
+ from sqlalchemy.sql import elements, selectable
46
46
  from sqlalchemy.sql.compiler import (
47
- SQLCompiler,
48
- GenericTypeCompiler,
49
47
  DDLCompiler,
48
+ GenericTypeCompiler,
50
49
  IdentifierPreparer,
50
+ SQLCompiler,
51
51
  )
52
- from sqlalchemy.sql.sqltypes import Integer, String, NullType, Numeric
53
- from sqlalchemy.engine.default import DefaultDialect, DefaultExecutionContext
54
- from sqlalchemy.engine.base import Engine
55
- from sqlalchemy.sql.schema import Column
56
- from sqlalchemy.sql.schema import Table
52
+ import sqlalchemy.sql.expression
53
+ import sqlalchemy.sql.functions
54
+ from sqlalchemy.sql.schema import Column, Table
57
55
  from sqlalchemy.sql.selectable import CTE
58
- from sqlalchemy.sql import elements, selectable
59
- import re
56
+ import sqlalchemy.sql.sqltypes
57
+ from sqlalchemy.sql.sqltypes import Integer, NullType, Numeric, String
58
+ import sqlalchemy.sql.type_api
59
+ import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base as vendored_postgresql
60
60
 
61
+ from . import _helpers, _types
61
62
  from .parse_url import parse_url
62
- from . import _helpers, _struct, _types
63
- import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base as vendored_postgresql
64
- from google.cloud.bigquery import QueryJobConfig
65
63
 
66
64
  # Illegal characters is intended to be all characters that are not explicitly
67
65
  # allowed as part of the flexible column names.
@@ -191,7 +189,7 @@ class BigQueryExecutionContext(DefaultExecutionContext):
191
189
  )
192
190
 
193
191
 
194
- class BigQueryCompiler(_struct.SQLCompiler, vendored_postgresql.PGCompiler):
192
+ class BigQueryCompiler(vendored_postgresql.PGCompiler, SQLCompiler):
195
193
  compound_keywords = SQLCompiler.compound_keywords.copy()
196
194
  compound_keywords[selectable.CompoundSelect.UNION] = "UNION DISTINCT"
197
195
  compound_keywords[selectable.CompoundSelect.UNION_ALL] = "UNION ALL"
@@ -217,6 +215,10 @@ class BigQueryCompiler(_struct.SQLCompiler, vendored_postgresql.PGCompiler):
217
215
  insert_stmt, asfrom=False, **kw
218
216
  )
219
217
 
218
+ def visit_json_getitem_op_binary(self, binary, operator_, **kw):
219
+ left = self.process(binary.left, **kw)
220
+ return f"{left}.{binary.right.value}"
221
+
220
222
  def visit_table_valued_alias(self, element, **kw):
221
223
  # When using table-valued functions, like UNNEST, BigQuery requires a
222
224
  # FROM for any table referenced in the function, including expressions
@@ -620,6 +622,9 @@ class BigQueryTypeCompiler(GenericTypeCompiler):
620
622
 
621
623
  visit_VARBINARY = visit_BLOB = visit_BINARY
622
624
 
625
+ def visit_JSON(self, type_, **kw):
626
+ return "JSON"
627
+
623
628
  def visit_NUMERIC(self, type_, **kw):
624
629
  if (type_.precision is not None) and isinstance(
625
630
  kw.get("type_expression"), Column
@@ -1409,10 +1414,10 @@ else:
1409
1414
  from alembic.ddl.base import (
1410
1415
  ColumnName,
1411
1416
  ColumnType,
1417
+ alter_column,
1418
+ alter_table,
1412
1419
  format_column_name,
1413
1420
  format_type,
1414
- alter_table,
1415
- alter_column,
1416
1421
  )
1417
1422
 
1418
1423
  class SqlalchemyBigqueryImpl(impl.DefaultImpl):
@@ -18,8 +18,8 @@
18
18
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
19
 
20
20
  import geoalchemy2
21
- from geoalchemy2.shape import to_shape
22
21
  import geoalchemy2.functions
22
+ from geoalchemy2.shape import to_shape
23
23
  from shapely import wkb, wkt
24
24
  import sqlalchemy.ext.compiler
25
25
  from sqlalchemy.sql.elements import BindParameter
@@ -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 is not 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
 
@@ -17,4 +17,4 @@
17
17
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
18
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
19
 
20
- __version__ = "1.16.0"
20
+ __version__ = "1.17.1"
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlalchemy-bigquery
3
- Version: 1.16.0
3
+ Version: 1.17.1
4
4
  Summary: SQLAlchemy dialect for BigQuery
5
- Home-page: https://github.com/googleapis/python-bigquery-sqlalchemy
5
+ Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/sqlalchemy-bigquery
6
6
  Author: The Sqlalchemy-Bigquery Authors
7
7
  Author-email: googleapis-packages@google.com
8
8
  Keywords: bigquery,sqlalchemy
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
15
  Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
@@ -22,13 +20,13 @@ Classifier: Programming Language :: Python :: 3.14
22
20
  Classifier: Operating System :: OS Independent
23
21
  Classifier: Topic :: Database :: Front-Ends
24
22
  Obsoletes: pybigquery
25
- Requires-Python: >=3.8, <3.15
23
+ Requires-Python: >=3.10
26
24
  Description-Content-Type: text/x-rst
27
25
  License-File: LICENSE
28
26
  License-File: AUTHORS
29
- Requires-Dist: google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0,>=1.31.5
30
- Requires-Dist: google-auth<3.0.0,>=1.25.0
31
- Requires-Dist: google-cloud-bigquery<4.0.0,>=3.3.6
27
+ Requires-Dist: google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0,>=2.11.1
28
+ Requires-Dist: google-auth<3.0.0,>=2.14.1
29
+ Requires-Dist: google-cloud-bigquery<4.0.0,>=3.20.0
32
30
  Requires-Dist: packaging
33
31
  Requires-Dist: sqlalchemy<3.0.0,>=1.4.16
34
32
  Provides-Extra: geography
@@ -40,22 +38,22 @@ Provides-Extra: tests
40
38
  Requires-Dist: packaging; extra == "tests"
41
39
  Requires-Dist: pytz; extra == "tests"
42
40
  Provides-Extra: bqstorage
43
- Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.0.0; extra == "bqstorage"
41
+ Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "bqstorage"
44
42
  Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "bqstorage"
45
43
  Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "bqstorage"
46
44
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14" and extra == "bqstorage"
47
- Requires-Dist: pyarrow>=5.0.0; extra == "bqstorage"
45
+ Requires-Dist: pyarrow>=6.0.0; extra == "bqstorage"
48
46
  Provides-Extra: all
49
- Requires-Dist: pytz; extra == "all"
50
- Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.0.0; extra == "all"
47
+ Requires-Dist: GeoAlchemy2; extra == "all"
48
+ Requires-Dist: google-cloud-bigquery-storage<3.0.0,>=2.18.0; extra == "all"
49
+ Requires-Dist: grpcio<2.0.0,>=1.49.1; python_version == "3.11" and extra == "all"
51
50
  Requires-Dist: shapely; extra == "all"
51
+ Requires-Dist: pyarrow>=6.0.0; extra == "all"
52
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.49.1; python_version == "3.11" and extra == "all"
53
+ Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
54
+ Requires-Dist: pytz; extra == "all"
54
55
  Requires-Dist: alembic; extra == "all"
55
- Requires-Dist: pyarrow>=5.0.0; extra == "all"
56
- Requires-Dist: GeoAlchemy2; extra == "all"
57
56
  Requires-Dist: packaging; extra == "all"
58
- Requires-Dist: grpcio<2.0.0,>=1.47.0; extra == "all"
59
57
  Dynamic: author
60
58
  Dynamic: author-email
61
59
  Dynamic: classifier
@@ -124,11 +122,11 @@ dependencies.
124
122
 
125
123
  Supported Python Versions
126
124
  ^^^^^^^^^^^^^^^^^^^^^^^^^
127
- Python >= 3.9, <3.14
125
+ Python >= 3.10, <= 3.14
128
126
 
129
127
  Unsupported Python Versions
130
128
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
- Python <= 3.7.
129
+ Python <= 3.9
132
130
 
133
131
 
134
132
  Mac/Linux
@@ -9,7 +9,6 @@ sqlalchemy_bigquery/__init__.py
9
9
  sqlalchemy_bigquery/_helpers.py
10
10
  sqlalchemy_bigquery/_struct.py
11
11
  sqlalchemy_bigquery/_types.py
12
- sqlalchemy_bigquery/_versions_helpers.py
13
12
  sqlalchemy_bigquery/base.py
14
13
  sqlalchemy_bigquery/geography.py
15
14
  sqlalchemy_bigquery/parse_url.py
@@ -1,6 +1,6 @@
1
- google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0,>=1.31.5
2
- google-auth<3.0.0,>=1.25.0
3
- google-cloud-bigquery<4.0.0,>=3.3.6
1
+ google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0,>=2.11.1
2
+ google-auth<3.0.0,>=2.14.1
3
+ google-cloud-bigquery<4.0.0,>=3.20.0
4
4
  packaging
5
5
  sqlalchemy<3.0.0,>=1.4.16
6
6
 
@@ -8,14 +8,14 @@ sqlalchemy<3.0.0,>=1.4.16
8
8
  alembic
9
9
 
10
10
  [all]
11
- pytz
12
- google-cloud-bigquery-storage<3.0.0,>=2.0.0
11
+ GeoAlchemy2
12
+ google-cloud-bigquery-storage<3.0.0,>=2.18.0
13
13
  shapely
14
+ pyarrow>=6.0.0
15
+ grpcio<2.0.0,>=1.47.0
16
+ pytz
14
17
  alembic
15
- pyarrow>=5.0.0
16
- GeoAlchemy2
17
18
  packaging
18
- grpcio<2.0.0,>=1.47.0
19
19
 
20
20
  [all:python_version == "3.11"]
21
21
  grpcio<2.0.0,>=1.49.1
@@ -24,9 +24,9 @@ grpcio<2.0.0,>=1.49.1
24
24
  grpcio<2.0.0,>=1.75.1
25
25
 
26
26
  [bqstorage]
27
- google-cloud-bigquery-storage<3.0.0,>=2.0.0
27
+ google-cloud-bigquery-storage<3.0.0,>=2.18.0
28
28
  grpcio<2.0.0,>=1.47.0
29
- pyarrow>=5.0.0
29
+ pyarrow>=6.0.0
30
30
 
31
31
  [bqstorage:python_version == "3.11"]
32
32
  grpcio<2.0.0,>=1.49.1
@@ -21,14 +21,15 @@ import contextlib
21
21
  import re
22
22
  import traceback
23
23
 
24
+ import google.cloud.bigquery.dbapi.connection
24
25
  from sqlalchemy.testing import config
25
26
  from sqlalchemy.testing.plugin.pytestplugin import * # noqa
26
27
  from sqlalchemy.testing.plugin.pytestplugin import (
27
- pytest_sessionstart as _pytest_sessionstart,
28
28
  pytest_sessionfinish as _pytest_sessionfinish,
29
29
  )
30
-
31
- import google.cloud.bigquery.dbapi.connection
30
+ from sqlalchemy.testing.plugin.pytestplugin import (
31
+ pytest_sessionstart as _pytest_sessionstart,
32
+ )
32
33
  import test_utils.prefixer
33
34
 
34
35
  import sqlalchemy_bigquery.base