Taragolis commented on code in PR #39270:
URL: https://github.com/apache/airflow/pull/39270#discussion_r1580560702
##########
airflow/operators/python.py:
##########
@@ -350,6 +343,36 @@ def get_tasks_to_skip():
return condition
+def _load_pickle():
+ import pickle
+
+ return pickle
+
+
+def _load_dill():
+ try:
+ import dill
+ except ImportError:
+ raise AirflowException("Unable to import 'dill' make sure that it
installed.")
Review Comment:
We could explicitly set cause by set `raise .. from exception` in this case
stack trace will show that this error is an actual reason to our custom
```console
[2024-04-26, 06:54:43 UTC] {taskinstance.py:2974} ERROR - Task failed with
exception
Traceback (most recent call last):
File "/opt/airflow/airflow/operators/python.py", line 362, in
_load_cloudpickle
import cloudpickle
ModuleNotFoundError: No module named 'cloudpickle'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
...
```
--
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]