diff options
author | MajorDallas <79329882+MajorDallas@users.noreply.github.com> | 2021-06-22 15:34:09 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-22 18:01:33 -0400 |
commit | ac20c3d34bf0127972acae8c712b98b1187b98f9 (patch) | |
tree | 3b515b81bc5745512c365aeaa97877e7c89225ad /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | a84881e1b7505c3ffb9b9f0ac2b227cbd650aac2 (diff) | |
download | sqlalchemy-ac20c3d34bf0127972acae8c712b98b1187b98f9.tar.gz |
Add impl property to PostgreSQL / Oracle INTERVAL class
Fixed issue where the ``INTERVAL`` datatype on PostgreSQL and Oracle would
produce an ``AttributeError`` when used in the context of a comparison
operation against a ``timedelta()`` object. Pull request courtesy
MajorDallas.
Fixes: #6649
Closes: #6650
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6650
Pull-request-sha: dd217a975e5f0d3157e81c731791225b6a32889f
Change-Id: I773caf2673294fdb3c92b42895ad714e944d1bf8
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index deb624329..4c7898132 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1655,6 +1655,9 @@ class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): def python_type(self): return dt.timedelta + def coerce_compared_value(self, op, value): + return self + PGInterval = INTERVAL |