From 9e3c8d0d71ae0aabe9f5abfae2db838cb80fe320 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 23 Oct 2021 11:26:45 -0400 Subject: replace Variant with direct feature inside of TypeEngine The :meth:`_sqltypes.TypeEngine.with_variant` method now returns a copy of the original :class:`_sqltypes.TypeEngine` object, rather than wrapping it inside the ``Variant`` class, which is effectively removed (the import symbol remains for backwards compatibility with code that may be testing for this symbol). While the previous approach maintained in-Python behaviors, maintaining the original type allows for clearer type checking and debugging. Fixes: #6980 Change-Id: I158c7e56306b886b5b82b040205c428a5c4a242c --- lib/sqlalchemy/testing/assertions.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/testing') diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 2acf15195..795b53804 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -515,6 +515,10 @@ class AssertsCompiledSQL: if hasattr(test_statement, "_return_defaults"): self._return_defaults = test_statement._return_defaults + @property + def _variant_mapping(self): + return self.test_statement._variant_mapping + def _default_dialect(self): return self.test_statement._default_dialect() -- cgit v1.2.1