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-Tag: rel_2_0_42~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74ef5a683fd3816d12be03e6c9919c65ab3f1173;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git guard against schema_translate_map adding/removing None vs. caching Change-Id: Iad29848b5fe15e314ad791b7fc0aac58700b0c68 (cherry picked from commit 1eb28772f0e602855cea292610f08d2581905d00) --- diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index 0df48f6fd1..c96cb90378 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"]