You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/07/05 12:51:44 UTC
[airflow] branch v2-3-test updated: Add cache_ok flag to sqlalchemy TypeDecorators. (#24499)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v2-3-test by this push:
new 679bd6afaf Add cache_ok flag to sqlalchemy TypeDecorators. (#24499)
679bd6afaf is described below
commit 679bd6afaf8f4012fcbe09e8b03f832442e856bf
Author: Jesse Kinkead <je...@falkon.ai>
AuthorDate: Tue Jul 5 05:50:20 2022 -0700
Add cache_ok flag to sqlalchemy TypeDecorators. (#24499)
(cherry picked from commit d9694733cafd9a3d637eb37d5154f0e1e92aadd4)
---
airflow/utils/sqlalchemy.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/airflow/utils/sqlalchemy.py b/airflow/utils/sqlalchemy.py
index 6d751d106a..b10af0a74d 100644
--- a/airflow/utils/sqlalchemy.py
+++ b/airflow/utils/sqlalchemy.py
@@ -58,6 +58,8 @@ class UtcDateTime(TypeDecorator):
impl = DateTime(timezone=True)
+ cache_ok = True
+
def process_bind_param(self, value, dialect):
if value is not None:
if not isinstance(value, datetime.datetime):
@@ -101,6 +103,8 @@ class ExtendedJSON(TypeDecorator):
impl = Text
+ cache_ok = True
+
def db_supports_json(self):
"""Checks if the database supports JSON (i.e. is NOT MSSQL)"""
return not conf.get("database", "sql_alchemy_conn").startswith("mssql")
@@ -143,6 +147,8 @@ class Interval(TypeDecorator):
impl = Text
+ cache_ok = True
+
attr_keys = {
datetime.timedelta: ('days', 'seconds', 'microseconds'),
relativedelta.relativedelta: (