bolkedebruin commented on code in PR #39420:
URL: https://github.com/apache/airflow/pull/39420#discussion_r1591401874


##########
airflow/providers/docker/decorators/docker.py:
##########
@@ -42,6 +48,41 @@ def _generate_decode_command(env_var, file, python_command):
     )
 
 
+def _load_pickle():
+    import pickle
+
+    return pickle
+
+
+def _load_dill():
+    try:
+        import dill
+    except ModuleNotFoundError:
+        log.error("Unable to import `dill` module. Please please make sure 
that it installed.")
+        raise
+    return dill
+
+
+def _load_cloudpickle():
+    try:
+        import cloudpickle
+    except ModuleNotFoundError:
+        log.error(
+            "Unable to import `cloudpickle` module. "
+            "Please install it with: pip install 
'apache-airflow-providers-docker[cloudpickle]'"
+        )
+        raise
+    return cloudpickle
+
+
+_SerializerTypeDef = Literal["pickle", "cloudpickle", "dill"]
+_SERIALIZERS: dict[_SerializerTypeDef, Any] = {
+    "pickle": lazy_object_proxy.Proxy(_load_pickle),
+    "dill": lazy_object_proxy.Proxy(_load_dill),
+    "cloudpickle": lazy_object_proxy.Proxy(_load_cloudpickle),
+}
+
+
 def _b64_encode_file(filename):

Review Comment:
   Ah sorry misjudged the context



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to