From 3b13ea614918b5759722d423f91e794a0d13ca15 Mon Sep 17 00:00:00 2001 From: Linchin Date: Wed, 5 Jun 2024 14:27:22 -0700 Subject: [PATCH 01/18] feat: support UPDATE JOIN --- sqlalchemy_bigquery/base.py | 8 ++++++++ tests/unit/test_compiler.py | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/sqlalchemy_bigquery/base.py b/sqlalchemy_bigquery/base.py index 636ef9c0..a3afcacd 100644 --- a/sqlalchemy_bigquery/base.py +++ b/sqlalchemy_bigquery/base.py @@ -388,6 +388,14 @@ def group_by_clause(self, select, **kw): repl=r" IN UNNEST([ \1 ])", ) + def update_from_clause( + self, update_stmt, from_table, extra_froms, from_hints, **kw + ): + kw["asfrom"] = True + return "FROM " + ", ".join( + t._compiler_dispatch(self, fromhints=from_hints, **kw) for t in extra_froms + ) + def visit_in_op_binary(self, binary, operator_, **kw): return self.__in_expanding_bind( self._generate_generic_binary(binary, " IN ", **kw) diff --git a/tests/unit/test_compiler.py b/tests/unit/test_compiler.py index cc9116e3..90249ca8 100644 --- a/tests/unit/test_compiler.py +++ b/tests/unit/test_compiler.py @@ -161,6 +161,33 @@ def prepare_implicit_join_base_query( return q +def test_update_from_clause(faux_conn, metadata): + table1 = setup_table( + faux_conn, + "table1", + metadata, + sqlalchemy.Column("foo", sqlalchemy.String), + sqlalchemy.Column("bar", sqlalchemy.Integer), + ) + table2 = setup_table( + faux_conn, + "table2", + metadata, + sqlalchemy.Column("foo", sqlalchemy.String), + sqlalchemy.Column("bar", sqlalchemy.Integer), + ) + + stmt = ( + sqlalchemy.update(table1) + .where(table1.c.foo == table2.c.foo) + .where(table2.c.bar == 1) + .values(bar=2) + ) + expected_sql = "UPDATE `table1` SET `bar`=%(bar:INT64)s FROM `table2` WHERE `table1`.`foo` = `table2`.`foo` AND `table2`.`bar` = %(bar_1:INT64)s" + found_sql = stmt.compile(faux_conn).string + assert found_sql == expected_sql + + @sqlalchemy_before_2_0 def test_no_implicit_join_asterix_for_inner_unnest_before_2_0(faux_conn, metadata): # See: https://github.com/googleapis/python-bigquery-sqlalchemy/issues/368 From 3cd5e5b57997656d80a4c51c20ddcb0f196d87c4 Mon Sep 17 00:00:00 2001 From: Linchin Date: Thu, 6 Jun 2024 14:41:01 -0700 Subject: [PATCH 02/18] vendor code from sqlalchemy --- setup.py | 19 +++++++++++- sqlalchemy_bigquery/base.py | 6 +++- .../sqlalchemy_bigquery_vendored/__init__.py | 0 .../sqlalchemy_bigquery_vendored/py.typed | 0 .../sqlalchemy/AUTHORS | 30 +++++++++++++++++++ .../sqlalchemy/LICENSE | 19 ++++++++++++ .../sqlalchemy/__init__.py | 6 ++++ .../sqlalchemy/postgresql/base.py | 19 ++++++++++++ 8 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 third_party/sqlalchemy_bigquery_vendored/__init__.py create mode 100644 third_party/sqlalchemy_bigquery_vendored/py.typed create mode 100644 third_party/sqlalchemy_bigquery_vendored/sqlalchemy/AUTHORS create mode 100644 third_party/sqlalchemy_bigquery_vendored/sqlalchemy/LICENSE create mode 100644 third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py create mode 100644 third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py diff --git a/setup.py b/setup.py index b33e1c6e..bf9ac538 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ import itertools import os import re +import setuptools from setuptools import setup # Package metadata. @@ -67,6 +68,18 @@ def readme(): extras["all"] = set(itertools.chain.from_iterable(extras.values())) +packages = ["sqlalchemy_bigquery", "sqlalchemy_bigquery_vendored"] + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("sqlalchemy_bigquery") +] + [ + package + for package in setuptools.find_namespace_packages("third_party") + if package.startswith("sqlalchemy_bigquery_vendored") +] + setup( name=name, version=version, @@ -75,7 +88,11 @@ def readme(): long_description_content_type="text/x-rst", author="The Sqlalchemy-Bigquery Authors", author_email="googleapis-packages@google.com", - packages=["sqlalchemy_bigquery"], + package_dir={ + "sqlalchemy-bigquery": "sqlalchemy_bigquery", + "sqlalchemy_bigquery_vendored": "third_party/sqlalchemy_bigquery_vendored", + }, + packages=packages, url="https://github.com/googleapis/python-bigquery-sqlalchemy", keywords=["bigquery", "sqlalchemy"], classifiers=[ diff --git a/sqlalchemy_bigquery/base.py b/sqlalchemy_bigquery/base.py index a3afcacd..b7f583b5 100644 --- a/sqlalchemy_bigquery/base.py +++ b/sqlalchemy_bigquery/base.py @@ -60,6 +60,7 @@ from .parse_url import parse_url from . import _helpers, _struct, _types +import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base # Illegal characters is intended to be all characters that are not explicitly # allowed as part of the flexible column names. @@ -189,7 +190,10 @@ def pre_exec(self): ) -class BigQueryCompiler(_struct.SQLCompiler, SQLCompiler): +class BigQueryCompiler( + _struct.SQLCompiler, + sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base.PGCompiler, +): compound_keywords = SQLCompiler.compound_keywords.copy() compound_keywords[selectable.CompoundSelect.UNION] = "UNION DISTINCT" compound_keywords[selectable.CompoundSelect.UNION_ALL] = "UNION ALL" diff --git a/third_party/sqlalchemy_bigquery_vendored/__init__.py b/third_party/sqlalchemy_bigquery_vendored/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/third_party/sqlalchemy_bigquery_vendored/py.typed b/third_party/sqlalchemy_bigquery_vendored/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/AUTHORS b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/AUTHORS new file mode 100644 index 00000000..98c5e111 --- /dev/null +++ b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/AUTHORS @@ -0,0 +1,30 @@ +SQLAlchemy was created by Michael Bayer. + +Major contributing authors include: + +- Mike Bayer +- Jason Kirtland +- Michael Trier +- Diana Clarke +- Gaetan de Menten +- Lele Gaifax +- Jonathan Ellis +- Gord Thompson +- Federico Caselli +- Philip Jenvey +- Rick Morrison +- Chris Withers +- Ants Aasma +- Sheila Allen +- Paul Johnston +- Tony Locke +- Hajime Nakagami +- Vraj Mohan +- Robert Leftwich +- Taavi Burns +- Jonathan Vanasco +- Jeff Widman +- Scott Dugas +- Dobes Vandermeer +- Ville Skytta +- Rodrigo Menezes diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/LICENSE b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/LICENSE new file mode 100644 index 00000000..967cdc5d --- /dev/null +++ b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/LICENSE @@ -0,0 +1,19 @@ +Copyright 2005-2024 SQLAlchemy authors and contributors . + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py new file mode 100644 index 00000000..ccdb8cc0 --- /dev/null +++ b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py @@ -0,0 +1,6 @@ +# __init__.py +# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors +# +# +# This module is part of SQLAlchemy and is released under +# the MIT License: https://www.opensource.org/licenses/mit-license.php \ No newline at end of file diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py new file mode 100644 index 00000000..1a90ab2e --- /dev/null +++ b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py @@ -0,0 +1,19 @@ +# dialects/postgresql/base.py +# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors +# +# +# This module is part of SQLAlchemy and is released under +# the MIT License: https://www.opensource.org/licenses/mit-license.php +# mypy: ignore-errors + +from sqlalchemy.sql import compiler + +class PGCompiler(compiler.SQLCompiler): + def update_from_clause( + self, update_stmt, from_table, extra_froms, from_hints, **kw + ): + kw["asfrom"] = True + return "FROM " + ", ".join( + t._compiler_dispatch(self, fromhints=from_hints, **kw) + for t in extra_froms + ) From f904928f4c4399e8ac1ea11e6c7da629ba27d236 Mon Sep 17 00:00:00 2001 From: Linchin Date: Thu, 6 Jun 2024 14:51:22 -0700 Subject: [PATCH 03/18] remove code and add comments --- sqlalchemy_bigquery/base.py | 8 -------- tests/unit/test_compiler.py | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sqlalchemy_bigquery/base.py b/sqlalchemy_bigquery/base.py index b7f583b5..97454879 100644 --- a/sqlalchemy_bigquery/base.py +++ b/sqlalchemy_bigquery/base.py @@ -392,14 +392,6 @@ def group_by_clause(self, select, **kw): repl=r" IN UNNEST([ \1 ])", ) - def update_from_clause( - self, update_stmt, from_table, extra_froms, from_hints, **kw - ): - kw["asfrom"] = True - return "FROM " + ", ".join( - t._compiler_dispatch(self, fromhints=from_hints, **kw) for t in extra_froms - ) - def visit_in_op_binary(self, binary, operator_, **kw): return self.__in_expanding_bind( self._generate_generic_binary(binary, " IN ", **kw) diff --git a/tests/unit/test_compiler.py b/tests/unit/test_compiler.py index 90249ca8..60ff3f0a 100644 --- a/tests/unit/test_compiler.py +++ b/tests/unit/test_compiler.py @@ -161,6 +161,8 @@ def prepare_implicit_join_base_query( return q +# Test vendored method update_from_clause() +# from sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base.PGCompiler def test_update_from_clause(faux_conn, metadata): table1 = setup_table( faux_conn, From 6c973e26cec9323e8513b25cab8464c57dc79f2a Mon Sep 17 00:00:00 2001 From: Linchin Date: Thu, 6 Jun 2024 15:22:10 -0700 Subject: [PATCH 04/18] add vendored folder to path in MANIFEST.in --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index e0a66705..effabf53 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! include README.rst LICENSE recursive-include google *.json *.proto py.typed +recursive-include third_party/sqlalchemy_bigquery_vendored * recursive-include tests * global-exclude *.py[co] global-exclude __pycache__ From 7f8596d36666c5ec892aa0dd3fcbab9c33f1a6da Mon Sep 17 00:00:00 2001 From: Linchin Date: Thu, 6 Jun 2024 15:30:25 -0700 Subject: [PATCH 05/18] remove extra code --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index bf9ac538..007d001f 100644 --- a/setup.py +++ b/setup.py @@ -68,8 +68,6 @@ def readme(): extras["all"] = set(itertools.chain.from_iterable(extras.values())) -packages = ["sqlalchemy_bigquery", "sqlalchemy_bigquery_vendored"] - packages = [ package for package in setuptools.find_namespace_packages() From 1320455ac08282271ea4b6dc5218902e0d22f45e Mon Sep 17 00:00:00 2001 From: Linchin Date: Fri, 7 Jun 2024 17:57:44 -0700 Subject: [PATCH 06/18] include third_party in pytest --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index 36729727..f27a7b88 100644 --- a/noxfile.py +++ b/noxfile.py @@ -225,6 +225,7 @@ def default(session, install_extras=True): "--cov-report=", "--cov-fail-under=0", os.path.join("tests", "unit"), + os.path.join("third_party", "sqlalchemy_bigquery_vendored"), *session.posargs, ) From 5f1b12ef0973e3dc61f467370c1896e001daab5e Mon Sep 17 00:00:00 2001 From: Linchin Date: Fri, 7 Jun 2024 18:14:12 -0700 Subject: [PATCH 07/18] update MANIFEST.in --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index effabf53..229766b1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! include README.rst LICENSE -recursive-include google *.json *.proto py.typed +recursive-include sqlalchemy_bigquery *.json *.proto py.typed recursive-include third_party/sqlalchemy_bigquery_vendored * recursive-include tests * global-exclude *.py[co] From 07876cf9c41c61d647f363425ebb642aceeae530 Mon Sep 17 00:00:00 2001 From: Linchin Date: Mon, 10 Jun 2024 10:51:24 -0700 Subject: [PATCH 08/18] add init file --- sqlalchemy_bigquery/base.py | 7 ++----- third_party/__init__.py | 0 2 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 third_party/__init__.py diff --git a/sqlalchemy_bigquery/base.py b/sqlalchemy_bigquery/base.py index 97454879..cffb9daa 100644 --- a/sqlalchemy_bigquery/base.py +++ b/sqlalchemy_bigquery/base.py @@ -60,7 +60,7 @@ from .parse_url import parse_url from . import _helpers, _struct, _types -import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base +import sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base as vendored_postgresql # Illegal characters is intended to be all characters that are not explicitly # allowed as part of the flexible column names. @@ -190,10 +190,7 @@ def pre_exec(self): ) -class BigQueryCompiler( - _struct.SQLCompiler, - sqlalchemy_bigquery_vendored.sqlalchemy.postgresql.base.PGCompiler, -): +class BigQueryCompiler(_struct.SQLCompiler, vendored_postgresql.PGCompiler): compound_keywords = SQLCompiler.compound_keywords.copy() compound_keywords[selectable.CompoundSelect.UNION] = "UNION DISTINCT" compound_keywords[selectable.CompoundSelect.UNION_ALL] = "UNION ALL" diff --git a/third_party/__init__.py b/third_party/__init__.py new file mode 100644 index 00000000..e69de29b From 3d55c449a53255b2236617378dd4c12f40a03115 Mon Sep 17 00:00:00 2001 From: Linchin Date: Mon, 10 Jun 2024 11:22:01 -0700 Subject: [PATCH 09/18] add init file --- .../sqlalchemy/postgresql/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/__init__.py diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/__init__.py b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/__init__.py new file mode 100644 index 00000000..e69de29b From 7264c68fcf9ecdc25f91e8ade62bfe66c002c8a5 Mon Sep 17 00:00:00 2001 From: Linchin Date: Tue, 11 Jun 2024 11:42:23 -0700 Subject: [PATCH 10/18] add pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..7fd26b97 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" \ No newline at end of file From 83097281a302d65e9c05a5a26ca9da50da6a755d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 11 Jun 2024 20:06:58 +0000 Subject: [PATCH 11/18] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- MANIFEST.in | 3 +-- noxfile.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 229766b1..e0a66705 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,8 +16,7 @@ # Generated by synthtool. DO NOT EDIT! include README.rst LICENSE -recursive-include sqlalchemy_bigquery *.json *.proto py.typed -recursive-include third_party/sqlalchemy_bigquery_vendored * +recursive-include google *.json *.proto py.typed recursive-include tests * global-exclude *.py[co] global-exclude __pycache__ diff --git a/noxfile.py b/noxfile.py index f27a7b88..36729727 100644 --- a/noxfile.py +++ b/noxfile.py @@ -225,7 +225,6 @@ def default(session, install_extras=True): "--cov-report=", "--cov-fail-under=0", os.path.join("tests", "unit"), - os.path.join("third_party", "sqlalchemy_bigquery_vendored"), *session.posargs, ) From e7c4c3e53cad952d279139a11794a3d960748ecc Mon Sep 17 00:00:00 2001 From: Linchin Date: Tue, 11 Jun 2024 16:33:48 -0700 Subject: [PATCH 12/18] update noxfile and owlbot --- noxfile.py | 4 +++- owlbot.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 36729727..e6383624 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,11 +31,13 @@ FLAKE8_VERSION = "flake8==6.1.0" BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" -LINT_PATHS = ["docs", "sqlalchemy_bigquery", "tests", "noxfile.py", "setup.py"] +LINT_PATHS = ["third_party", "docs", "sqlalchemy_bigquery", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] + UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", diff --git a/owlbot.py b/owlbot.py index 9d4aaafc..87554d30 100644 --- a/owlbot.py +++ b/owlbot.py @@ -15,6 +15,7 @@ """This script is used to synthesize generated parts of this library.""" import pathlib +import re import synthtool as s from synthtool import gcp @@ -76,6 +77,11 @@ "import re\nimport shutil", ) +s.replace( + ["noxfile.py"], + "LINT_PATHS = [", + "LINT_PATHS = [\"third_party\", " +) s.replace( ["noxfile.py"], @@ -83,6 +89,12 @@ "--cov=sqlalchemy_bigquery", ) +s.replace( + ["noxfile.py"], + """os.path.join("tests", "unit"),""", + """os.path.join("tests", "unit"), + os.path.join("third_party", "sqlalchemy_bigquery_vendored"),""", +) s.replace( ["noxfile.py"], @@ -284,6 +296,15 @@ def system_noextras(session): """, ) + +# Make sure build includes all necessary files. +s.replace( + ["MANIFEST.in"], + re.escape("recursive-include google"), + """recursive-include third_party/sqlalchemy_bigquery_vendored * +recursive-include sqlalchemy_bigquery""", +) + # ---------------------------------------------------------------------------- # Samples templates # ---------------------------------------------------------------------------- From 090b0943f8969b4577cb61e884c4557d2bda6d2f Mon Sep 17 00:00:00 2001 From: Linchin Date: Tue, 11 Jun 2024 16:33:59 -0700 Subject: [PATCH 13/18] lint --- .../sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py | 2 +- .../sqlalchemy/postgresql/base.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py index ccdb8cc0..71aff78e 100644 --- a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py +++ b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/__init__.py @@ -3,4 +3,4 @@ # # # This module is part of SQLAlchemy and is released under -# the MIT License: https://www.opensource.org/licenses/mit-license.php \ No newline at end of file +# the MIT License: https://www.opensource.org/licenses/mit-license.php diff --git a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py index 1a90ab2e..b43ec44f 100644 --- a/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py +++ b/third_party/sqlalchemy_bigquery_vendored/sqlalchemy/postgresql/base.py @@ -8,12 +8,12 @@ from sqlalchemy.sql import compiler + class PGCompiler(compiler.SQLCompiler): def update_from_clause( self, update_stmt, from_table, extra_froms, from_hints, **kw ): kw["asfrom"] = True return "FROM " + ", ".join( - t._compiler_dispatch(self, fromhints=from_hints, **kw) - for t in extra_froms + t._compiler_dispatch(self, fromhints=from_hints, **kw) for t in extra_froms ) From 4b5c894b9fc05f143172318cb2283ec6b2715cce Mon Sep 17 00:00:00 2001 From: Linchin Date: Tue, 11 Jun 2024 16:58:34 -0700 Subject: [PATCH 14/18] fix owlbot --- owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owlbot.py b/owlbot.py index 87554d30..0aaa33bf 100644 --- a/owlbot.py +++ b/owlbot.py @@ -79,7 +79,7 @@ s.replace( ["noxfile.py"], - "LINT_PATHS = [", + "LINT_PATHS = \[", "LINT_PATHS = [\"third_party\", " ) From d42cbb1b93bd55edd65e39d13d1d4575e42c7146 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 12 Jun 2024 00:04:56 +0000 Subject: [PATCH 15/18] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- MANIFEST.in | 3 ++- noxfile.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index e0a66705..66fc8ef3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,7 +16,8 @@ # Generated by synthtool. DO NOT EDIT! include README.rst LICENSE -recursive-include google *.json *.proto py.typed +recursive-include third_party/sqlalchemy_bigquery_vendored * +recursive-include sqlalchemy_bigquery *.json *.proto py.typed recursive-include tests * global-exclude *.py[co] global-exclude __pycache__ diff --git a/noxfile.py b/noxfile.py index e6383624..420b097c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,13 +31,18 @@ FLAKE8_VERSION = "flake8==6.1.0" BLACK_VERSION = "black[jupyter]==23.7.0" ISORT_VERSION = "isort==5.11.0" -LINT_PATHS = ["third_party", "docs", "sqlalchemy_bigquery", "tests", "noxfile.py", "setup.py"] +LINT_PATHS = [ + "third_party", + "docs", + "sqlalchemy_bigquery", + "tests", + "noxfile.py", + "setup.py", +] DEFAULT_PYTHON_VERSION = "3.8" UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] -UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] - UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", From 3c94acac20aa179b1b563a2685549f6734fa79ea Mon Sep 17 00:00:00 2001 From: Linchin Date: Tue, 11 Jun 2024 17:12:33 -0700 Subject: [PATCH 16/18] undo changes for testing --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index 420b097c..83169fa7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -43,6 +43,7 @@ DEFAULT_PYTHON_VERSION = "3.8" UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] + UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", From 8ff10f8ba1158a16a75ba30f796288773f45f0c7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 12 Jun 2024 00:14:37 +0000 Subject: [PATCH 17/18] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- noxfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 83169fa7..420b097c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -43,7 +43,6 @@ DEFAULT_PYTHON_VERSION = "3.8" UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"] - UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", From 63d69d33a287b6e3b2a02c1f4b374afc30b6ff0e Mon Sep 17 00:00:00 2001 From: Lingqing Gan Date: Wed, 12 Jun 2024 11:09:19 -0700 Subject: [PATCH 18/18] add comments to pyproject.toml --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7fd26b97..0a21fc9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,5 @@ +# Added so third_party folder is included when running `pip install -e .` +# See PR #1083 for more detail [build-system] requires = ["setuptools"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta"