diff --git a/.kokoro/presubmit/compliance.cfg b/.kokoro/presubmit/compliance.cfg index d6cf2690..972cbc50 100644 --- a/.kokoro/presubmit/compliance.cfg +++ b/.kokoro/presubmit/compliance.cfg @@ -3,5 +3,5 @@ # Only run this nox session. env_vars: { key: "NOX_SESSION" - value: "compliance_test_13" + value: "compliance_test_20" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ecea6c5..750d7840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.6.1](https://github.com/googleapis/python-spanner-sqlalchemy/compare/v1.6.0...v1.6.1) (2023-05-23) + + +### Bug Fixes + +* Add opentelemetry version ([#322](https://github.com/googleapis/python-spanner-sqlalchemy/issues/322)) ([b80d24d](https://github.com/googleapis/python-spanner-sqlalchemy/commit/b80d24d251f07d4c000aa214955cf9729cd49545)) +* Fix check so it's all lowercase. ([#321](https://github.com/googleapis/python-spanner-sqlalchemy/issues/321)) ([8fae358](https://github.com/googleapis/python-spanner-sqlalchemy/commit/8fae3587d5c963539b255c976136b18041147e5b)) + ## [1.6.0](https://github.com/googleapis/python-spanner-sqlalchemy/compare/v1.5.0...v1.6.0) (2023-04-26) diff --git a/create_test_database.py b/create_test_database.py index 4d740ddf..915c5040 100644 --- a/create_test_database.py +++ b/create_test_database.py @@ -70,7 +70,7 @@ def create_test_instance(): configs = list(CLIENT.list_instance_configs()) if not USE_EMULATOR: # Filter out non "us" locations - configs = [config for config in configs if "us-west1" in config.name] + configs = [config for config in configs if "asia-southeast1" in config.name] instance_config = configs[0].name create_time = str(int(time.time())) diff --git a/google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py b/google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py index b6bf3278..f350146e 100644 --- a/google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py +++ b/google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py @@ -182,6 +182,7 @@ class SpannerIdentifierPreparer(IdentifierPreparer): reserved_words = RESERVED_WORDS.copy() reserved_words.update(spanner_dbapi.parse_utils.SPANNER_RESERVED_KEYWORDS) + reserved_words_lc = set(map(str.lower, reserved_words)) def __init__(self, dialect): super(SpannerIdentifierPreparer, self).__init__( @@ -195,7 +196,7 @@ def _requires_quotes(self, value): return False return ( - lc_value in self.reserved_words + lc_value in self.reserved_words_lc or value[0] in self.illegal_initial_characters or not self.legal_characters.match(str(value)) or (lc_value != value) diff --git a/noxfile.py b/noxfile.py index 394269df..77df05f7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -212,6 +212,10 @@ def compliance_test_14(session): def compliance_test_20(session): """Run SQLAlchemy dialect compliance test suite.""" + # Check the value of `RUN_COMPLIANCE_TESTS` env var. It defaults to true. + if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false": + session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping") + # Sanity check: Only run tests if the environment variable is set. if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", "") and not os.environ.get( "SPANNER_EMULATOR_HOST", "" @@ -228,6 +232,7 @@ def compliance_test_20(session): session.install("mock") session.install("-e", ".[tracing]") + session.run("pip", "install", "opentelemetry-api<=1.10", "--force-reinstall") session.run("python", "create_test_database.py") session.install("sqlalchemy>=2.0") diff --git a/version.py b/version.py index d22bc465..a75219ed 100644 --- a/version.py +++ b/version.py @@ -4,4 +4,4 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -__version__ = "1.6.0" +__version__ = "1.6.1"