From 2644d4cb51ed580cb9c4eb3cb600a056a2c893a3 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 13 Nov 2019 10:09:54 -0500 Subject: Base mssql.DATETIMEOFFSET on DateTime Fixed the base class of the :class:`.mssql.DATETIMEOFFSET` datatype to be based on the :class:`.DateTime` class hierarchy, as this is a datetime-holding datatype. Note however that at the moment the pyodbc driver has only limited support for this datatype and will not work with all ODBC drivers. References: https://github.com/mkleehammer/pyodbc/issues/134 Fixes: #4980 Change-Id: I946cf22642eea4beee2a605d91218c6fd817740c --- lib/sqlalchemy/dialects/mssql/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/dialects') diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 261ebe5c2..ded90c348 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1019,11 +1019,11 @@ class DATETIME2(_DateTimeBase, sqltypes.DateTime): self.precision = precision -# TODO: is this not an Interval ? -class DATETIMEOFFSET(sqltypes.TypeEngine): +class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime): __visit_name__ = "DATETIMEOFFSET" - def __init__(self, precision=None, **kwargs): + def __init__(self, precision=None, **kw): + super(DATETIMEOFFSET, self).__init__(**kw) self.precision = precision -- cgit v1.2.1