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
--- /dev/null
+.. change::
+ :tags: bug, mssql
+ :tickets: 4980
+
+ 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.
+
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