]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
replace Variant with direct feature inside of TypeEngine
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 23 Oct 2021 15:26:45 +0000 (11:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Dec 2021 16:43:53 +0000 (11:43 -0500)
commit9e3c8d0d71ae0aabe9f5abfae2db838cb80fe320
treea63c2c87acb3b9ce40cfce839bbf808206af1d98
parent3210348fd41d7efb7871afb24ee4e65a1f88f245
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
doc/build/changelog/migration_20.rst
doc/build/changelog/unreleased_20/6980.rst [new file with mode: 0644]
doc/build/conf.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/testing/assertions.py
test/dialect/postgresql/test_types.py
test/sql/test_types.py