From 74ef5a683fd3816d12be03e6c9919c65ab3f1173 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 10 Jun 2025 09:21:01 -0400 Subject: [PATCH] guard against schema_translate_map adding/removing None vs. caching Change-Id: Iad29848b5fe15e314ad791b7fc0aac58700b0c68 (cherry picked from commit 1eb28772f0e602855cea292610f08d2581905d00) --- test/dialect/postgresql/test_types.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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"] -- 2.47.2