Skip to content

Commit

Permalink
Avoid hardcoded unpicklable_properties in task.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Mar 16, 2018
1 parent dc2a74a commit c319bf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion luigi/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import copy
import functools

import luigi

This comment has been minimized.

Copy link
@Tarrasch

Tarrasch Mar 16, 2018

Contributor

Just wondering if this will cause any cyclic dependency issues.

This comment has been minimized.

Copy link
@riga

riga Mar 16, 2018

Author Contributor

At this point, the "luigi" entry should already be in sys.modules, so nothing should be loaded twice. It surely isn't loaded completely yet, but as far as I can see nothing else in task.py relies on it.

from luigi import six

from luigi import parameter
Expand Down Expand Up @@ -686,7 +687,7 @@ def _dump(self):
pickle.dumps(self)
"""
unpicklable_properties = ('set_tracking_url', 'set_status_message', 'set_progress_percentage')
unpicklable_properties = tuple(luigi.worker.TaskProcess.forward_reporter_callbacks.values())
reserved_properties = {}
for property_name in unpicklable_properties:
if hasattr(self, property_name):
Expand Down

0 comments on commit c319bf1

Please sign in to comment.