airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Refactor cloudpickle support in Python operators/decorators

Open Taragolis opened this issue 1 year ago • 0 comments

Some refactor cloudpickle support which added into the https://github.com/apache/airflow/pull/38531

Use new serializer parameter for specify serialiser, this one for avoid boolean trap. Deprecate use_dill parameter in favor of serializer="dill" and remove use_cloudpickle in favor of serializer="cloudpickle", this one safe to remove because change not released yet.

Fix situation if cloudpickle installed then dill serialisation not available and implicitly use cloudpickle instead.

https://github.com/apache/airflow/blob/adeb7f7cba2ab2b16be2e006c17e140fe91fdf77/airflow/operators/python.py#L61-L66

In addition lazy load serialisers as late as possible, for avoid the situation that we load all serialiser even if users do not use any of them

cc @VladaZakharova


^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Taragolis avatar Apr 25 '24 23:04 Taragolis