From 2297b6b91b116fa26f027e80f4cf7a14854b3ad4 Mon Sep 17 00:00:00 2001 From: Daniel Standish <15932138+dstandish@users.noreply.github.com> Date: Mon, 19 Sep 2022 22:18:47 -0700 Subject: [PATCH] ExecutorConfigType should be cacheable (#26498) Apparently the cache_ok attribute must be applied to all subclasses too. So we must apply it here. This allows sqlalchemy to use the caching behavior introduced with version 1.4. See https://docs.sqlalchemy.org/en/14/core/type_api.html#sqlalchemy.types.ExternalType.cache_ok for more info. (cherry picked from commit ba9edda254a52af6915bd20d569a9f8c8dfb4bf9) --- airflow/utils/sqlalchemy.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airflow/utils/sqlalchemy.py b/airflow/utils/sqlalchemy.py index 1132ded87a915..ef0d29ebf8a72 100644 --- a/airflow/utils/sqlalchemy.py +++ b/airflow/utils/sqlalchemy.py @@ -161,6 +161,8 @@ class ExecutorConfigType(PickleType): Airflow's serializer before pickling. """ + cache_ok = True + def bind_processor(self, dialect): from airflow.serialization.serialized_objects import BaseSerialization