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 /test/dialect/postgresql | |
| 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 'test/dialect/postgresql')
| -rw-r--r-- | test/dialect/postgresql/test_types.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index c83fe0f8a..3fdb31b7c 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -2427,6 +2427,10 @@ class TimestampTest(fixtures.TestBase, AssertsExecutionResults): eq_(expr.type._type_affinity, types.Interval) assert isinstance(expr.type, postgresql.INTERVAL) + def test_interval_coercion_literal(self): + expr = column("bar", postgresql.INTERVAL) == datetime.timedelta(days=1) + eq_(expr.right.type._type_affinity, types.Interval) + class SpecialTypesCompileTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = "postgresql" |
