diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-12-21 16:10:34 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-12-21 16:12:53 -0500 |
commit | b973cbd8939f2cc0e29c668fffd507958c3e455a (patch) | |
tree | c42e547b00e50ed06fe1601b09fbb3053ab53b6e /lib/sqlalchemy/dialects/postgresql/ranges.py | |
parent | 9749a394b19e78086103b3c01144a03061bb9c75 (diff) | |
download | sqlalchemy-b973cbd8939f2cc0e29c668fffd507958c3e455a.tar.gz |
check for adapt to same class in AbstractRange
Fixed regression where newly revised PostgreSQL range types such as
:class:`_postgresql.INT4RANGE` could not be set up as the impl of a
:class:`.TypeDecorator` custom type, instead raising a ``TypeError``.
Fixes: #9020
Change-Id: Ib881c3c7f63d000f49a09185a8663659a9970aa9
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/ranges.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/ranges.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py index 609af5eb6..69fc1977d 100644 --- a/lib/sqlalchemy/dialects/postgresql/ranges.py +++ b/lib/sqlalchemy/dialects/postgresql/ranges.py @@ -691,7 +691,7 @@ class AbstractRange(sqltypes.TypeEngine[Range[_T]]): and also render as ``INT4RANGE`` in SQL and DDL. """ - if issubclass(cls, AbstractRangeImpl): + if issubclass(cls, AbstractRangeImpl) and cls is not self.__class__: # two ways to do this are: 1. create a new type on the fly # or 2. have AbstractRangeImpl(visit_name) constructor and a # visit_abstract_range_impl() method in the PG compiler. |