Skip to content

Commit

Permalink
Fix the implementation of UtcDateTime for MsSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
potiuk committed Jul 5, 2022
1 parent 16c734d commit 21a37cf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions airflow/utils/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import pendulum
from dateutil import relativedelta
from sqlalchemy import and_, event, false, nullsfirst, or_, tuple_
from sqlalchemy.dialects import mssql
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm.session import Session
from sqlalchemy.sql import ColumnElement
Expand Down Expand Up @@ -94,6 +95,11 @@ def process_result_value(self, value, dialect):

return value

def load_dialect_impl(self, dialect):
if dialect.name == 'mssql':
return mssql.DATETIME2(precision=6)
return super().load_dialect_impl(dialect)


class ExtendedJSON(TypeDecorator):
"""
Expand Down

0 comments on commit 21a37cf

Please sign in to comment.