From: Mike Bayer Date: Tue, 10 Jun 2025 13:21:01 +0000 (-0400) Subject: guard against schema_translate_map adding/removing None vs. caching X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1eb28772f0e602855cea292610f08d2581905d00;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git guard against schema_translate_map adding/removing None vs. caching Change-Id: Iad29848b5fe15e314ad791b7fc0aac58700b0c68 --- diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index 7f8dab584e..6151ed2dcc 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -405,9 +405,18 @@ class NamedTypeTest( Column("value", dt), schema=symbol_name, ) - conn = connection.execution_options( - schema_translate_map={symbol_name: testing.config.test_schema} - ) + + execution_opts = { + "schema_translate_map": {symbol_name: testing.config.test_schema} + } + + if symbol_name is None: + # we are adding/ removing None from the schema_translate_map across + # runs, so we can't use caching else compiler will raise if it sees + # an inconsistency here + execution_opts["compiled_cache"] = None # type: ignore + + conn = connection.execution_options(**execution_opts) t1.create(conn) assert "schema_mytype" in [ e["name"]