From 25b4acdc0df373a4621d6e8eda9933ada6cba75f Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Tue, 25 Oct 2022 14:27:37 +0000 Subject: [PATCH 1/9] Sets cache support to false, removes upper req limit --- setup.py | 2 +- sqlalchemy_bigquery/base.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4afe003e..3d876748 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ def readme(): # https://github.com/googleapis/python-bigquery-sqlalchemy/issues/386 # and # https://github.com/googleapis/python-bigquery-sqlalchemy/issues/385 - "sqlalchemy>=1.2.0,<=1.4.27", + "sqlalchemy>=1.2.0", "future", ], extras_require=extras, diff --git a/sqlalchemy_bigquery/base.py b/sqlalchemy_bigquery/base.py index 3a26b330..32247a45 100644 --- a/sqlalchemy_bigquery/base.py +++ b/sqlalchemy_bigquery/base.py @@ -733,6 +733,7 @@ class BigQueryDialect(DefaultDialect): supports_default_values = False supports_empty_insert = False supports_multivalues_insert = True + supports_statement_cache = False supports_unicode_statements = True supports_unicode_binds = True supports_native_decimal = True From 55a2dceb5da812d5339e78a5356d77db39848b32 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 1 Feb 2023 13:40:49 +0000 Subject: [PATCH 2/9] fix: adds logic to ensure repo installation --- samples/snippets/noxfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 1224cbe2..fa4295e4 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -220,6 +220,10 @@ def _session_tests( if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) + else: + # ensure that sqlalchemy_bigquery gets installed + # for tests that are not based on source + session.install("sqlalchemy_bigquery") if post_install: post_install(session) From 990d745487b52af976f2822180b906e7640ab0c1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Feb 2023 13:45:57 +0000 Subject: [PATCH 3/9] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-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 --- samples/snippets/noxfile.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index fa4295e4..1224cbe2 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -220,10 +220,6 @@ def _session_tests( if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) - else: - # ensure that sqlalchemy_bigquery gets installed - # for tests that are not based on source - session.install("sqlalchemy_bigquery") if post_install: post_install(session) From bd3393912048444815315021908fa9003ba185fb Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 1 Feb 2023 15:53:59 +0000 Subject: [PATCH 4/9] edits to owlbot to ensure that changes persist --- owlbot.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/owlbot.py b/owlbot.py index aac3da31..4c065f89 100644 --- a/owlbot.py +++ b/owlbot.py @@ -94,6 +94,8 @@ # dependency of grpc''', ) + + def place_before(path, text, *before_text, escape=None): replacement = "\n".join(before_text) + "\n" + text if escape: @@ -211,10 +213,23 @@ def compliance(session): python.py_samples(skip_readmes=True) +s.replace( + ["./samples/snippets/noxfile.py"], + """session.install\("-e", _get_repo_root\(\)\)""", + """session.install("-e", _get_repo_root()) + else: + # ensure that sqlalchemy_bigquery gets installed + # for tests that are not based on source + session.install("sqlalchemy_bigquery")""", +) + + # ---------------------------------------------------------------------------- # Final cleanup # ---------------------------------------------------------------------------- +""" s.shell.run(["nox", "-s", "blacken"], hide_output=False) for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"): s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False) +""" \ No newline at end of file From 98df54c784a3005a45e7cbe7d2fe2fe5f4955ba7 Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 1 Feb 2023 15:55:44 +0000 Subject: [PATCH 5/9] more edits to owlbot to ensure that changes persist --- owlbot.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/owlbot.py b/owlbot.py index 4c065f89..1ea90868 100644 --- a/owlbot.py +++ b/owlbot.py @@ -228,8 +228,6 @@ def compliance(session): # Final cleanup # ---------------------------------------------------------------------------- -""" s.shell.run(["nox", "-s", "blacken"], hide_output=False) for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"): s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False) -""" \ No newline at end of file From 56ad4d5d8796469a8d230a2c6f1fe81796d39d13 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Feb 2023 15:56:19 +0000 Subject: [PATCH 6/9] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-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 | 15 +++++++-------- samples/snippets/noxfile.py | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/noxfile.py b/noxfile.py index 2c4cc035..2046b61c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,6 +283,7 @@ def system(session): ) + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1]) def compliance(session): """Run the SQLAlchemy dialect-compliance system tests""" @@ -299,7 +300,7 @@ def compliance(session): session.skip("Compliance tests were not found") session.install("--pre", "grpcio") - session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0") + session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0") session.install( "mock", # TODO: Allow latest version of pytest once SQLAlchemy 1.4.28+ is supported. @@ -338,6 +339,7 @@ def compliance(session): ) + @nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -358,9 +360,7 @@ def docs(session): session.install("-e", ".") session.install( "sphinx==4.0.1", - "alabaster", - "geoalchemy2", - "shapely", + "alabaster", "geoalchemy2", "shapely", "recommonmark", ) @@ -386,9 +386,7 @@ def docfx(session): session.install("-e", ".") session.install( "sphinx==4.0.1", - "alabaster", - "geoalchemy2", - "shapely", + "alabaster", "geoalchemy2", "shapely", "recommonmark", "gcp-sphinx-docfx-yaml", ) @@ -428,7 +426,8 @@ def prerelease_deps(session): unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES session.install(*unit_deps_all) system_deps_all = ( - SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES + SYSTEM_TEST_STANDARD_DEPENDENCIES + + SYSTEM_TEST_EXTERNAL_DEPENDENCIES ) session.install(*system_deps_all) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 1224cbe2..abbd28a1 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -160,7 +160,6 @@ def blacken(session: nox.sessions.Session) -> None: # format = isort + black # - @nox.session def format(session: nox.sessions.Session) -> None: """ @@ -188,9 +187,7 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( - "**/test_*.py", recursive=True - ) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: @@ -212,7 +209,9 @@ def _session_tests( if os.path.exists("requirements-test.txt"): if os.path.exists("constraints-test.txt"): - session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") + session.install( + "-r", "requirements-test.txt", "-c", "constraints-test.txt" + ) else: session.install("-r", "requirements-test.txt") with open("requirements-test.txt") as rtfile: @@ -220,14 +219,18 @@ def _session_tests( if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) + else: + # ensure that sqlalchemy_bigquery gets installed + # for tests that are not based on source + session.install("sqlalchemy_bigquery") if post_install: post_install(session) if "pytest-parallel" in packages: - concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) + concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) elif "pytest-xdist" in packages: - concurrent_args.extend(["-n", "auto"]) + concurrent_args.extend(['-n', 'auto']) session.run( "pytest", @@ -257,7 +260,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """Returns the root folder of the project.""" + """ Returns the root folder of the project. """ # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): From ffce56f89df639bdfc4fff82ad8bbe8f74107f62 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Feb 2023 15:57:44 +0000 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-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 --- samples/snippets/noxfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 1224cbe2..fa4295e4 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -220,6 +220,10 @@ def _session_tests( if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) + else: + # ensure that sqlalchemy_bigquery gets installed + # for tests that are not based on source + session.install("sqlalchemy_bigquery") if post_install: post_install(session) From 60e6e6f349d376d8a31f36374343d3feb53cc1ab Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Feb 2023 15:58:17 +0000 Subject: [PATCH 8/9] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-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 | 15 ++++++++------- samples/snippets/noxfile.py | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/noxfile.py b/noxfile.py index 2046b61c..2c4cc035 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,7 +283,6 @@ def system(session): ) - @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1]) def compliance(session): """Run the SQLAlchemy dialect-compliance system tests""" @@ -300,7 +299,7 @@ def compliance(session): session.skip("Compliance tests were not found") session.install("--pre", "grpcio") - session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0") + session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0") session.install( "mock", # TODO: Allow latest version of pytest once SQLAlchemy 1.4.28+ is supported. @@ -339,7 +338,6 @@ def compliance(session): ) - @nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -360,7 +358,9 @@ def docs(session): session.install("-e", ".") session.install( "sphinx==4.0.1", - "alabaster", "geoalchemy2", "shapely", + "alabaster", + "geoalchemy2", + "shapely", "recommonmark", ) @@ -386,7 +386,9 @@ def docfx(session): session.install("-e", ".") session.install( "sphinx==4.0.1", - "alabaster", "geoalchemy2", "shapely", + "alabaster", + "geoalchemy2", + "shapely", "recommonmark", "gcp-sphinx-docfx-yaml", ) @@ -426,8 +428,7 @@ def prerelease_deps(session): unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES session.install(*unit_deps_all) system_deps_all = ( - SYSTEM_TEST_STANDARD_DEPENDENCIES - + SYSTEM_TEST_EXTERNAL_DEPENDENCIES + SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES ) session.install(*system_deps_all) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index abbd28a1..fa4295e4 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -160,6 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # format = isort + black # + @nox.session def format(session: nox.sessions.Session) -> None: """ @@ -187,7 +188,9 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( + "**/test_*.py", recursive=True + ) test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: @@ -209,9 +212,7 @@ def _session_tests( if os.path.exists("requirements-test.txt"): if os.path.exists("constraints-test.txt"): - session.install( - "-r", "requirements-test.txt", "-c", "constraints-test.txt" - ) + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") else: session.install("-r", "requirements-test.txt") with open("requirements-test.txt") as rtfile: @@ -228,9 +229,9 @@ def _session_tests( post_install(session) if "pytest-parallel" in packages: - concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) + concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) elif "pytest-xdist" in packages: - concurrent_args.extend(['-n', 'auto']) + concurrent_args.extend(["-n", "auto"]) session.run( "pytest", @@ -260,7 +261,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): From 4ddb69db69da940ef1a8032067614b61ecedaae0 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Feb 2023 15:59:40 +0000 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-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 | 15 ++++++++------- samples/snippets/noxfile.py | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/noxfile.py b/noxfile.py index 2046b61c..2c4cc035 100644 --- a/noxfile.py +++ b/noxfile.py @@ -283,7 +283,6 @@ def system(session): ) - @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS[-1]) def compliance(session): """Run the SQLAlchemy dialect-compliance system tests""" @@ -300,7 +299,7 @@ def compliance(session): session.skip("Compliance tests were not found") session.install("--pre", "grpcio") - session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0") + session.install("--pre", "--no-deps", "--upgrade", "sqlalchemy<2.0.0") session.install( "mock", # TODO: Allow latest version of pytest once SQLAlchemy 1.4.28+ is supported. @@ -339,7 +338,6 @@ def compliance(session): ) - @nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -360,7 +358,9 @@ def docs(session): session.install("-e", ".") session.install( "sphinx==4.0.1", - "alabaster", "geoalchemy2", "shapely", + "alabaster", + "geoalchemy2", + "shapely", "recommonmark", ) @@ -386,7 +386,9 @@ def docfx(session): session.install("-e", ".") session.install( "sphinx==4.0.1", - "alabaster", "geoalchemy2", "shapely", + "alabaster", + "geoalchemy2", + "shapely", "recommonmark", "gcp-sphinx-docfx-yaml", ) @@ -426,8 +428,7 @@ def prerelease_deps(session): unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES session.install(*unit_deps_all) system_deps_all = ( - SYSTEM_TEST_STANDARD_DEPENDENCIES - + SYSTEM_TEST_EXTERNAL_DEPENDENCIES + SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES ) session.install(*system_deps_all) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index abbd28a1..fa4295e4 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -160,6 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # format = isort + black # + @nox.session def format(session: nox.sessions.Session) -> None: """ @@ -187,7 +188,9 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( + "**/test_*.py", recursive=True + ) test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: @@ -209,9 +212,7 @@ def _session_tests( if os.path.exists("requirements-test.txt"): if os.path.exists("constraints-test.txt"): - session.install( - "-r", "requirements-test.txt", "-c", "constraints-test.txt" - ) + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") else: session.install("-r", "requirements-test.txt") with open("requirements-test.txt") as rtfile: @@ -228,9 +229,9 @@ def _session_tests( post_install(session) if "pytest-parallel" in packages: - concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) + concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) elif "pytest-xdist" in packages: - concurrent_args.extend(['-n', 'auto']) + concurrent_args.extend(["-n", "auto"]) session.run( "pytest", @@ -260,7 +261,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10):