Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to check task definition to create an output #205

Merged
merged 5 commits into from
May 7, 2021

Conversation

hiro-o918
Copy link
Contributor

What

Add a feature to create a hash of a task.
The hash is created by cloudpickle.dumps to the class object of a task.

Why

Current implementation assumes that an output is determined by input parameters and requirements.
But this assumption does not work, when the implementation of a task changes.

As a results, some issues can occur.

  • In local development, we need to remove output .pkl to rerun tasks
    • modification_time_check can resolve this in some aspects (I like this option)
  • In production with some storage (e.g. S3), backfilling or re-running can be difficult because output .pkl must be removed as well as local development.

So, adding task definition to hash resolves these issues and re-reruns tasks safely.

Discussion

  • this feature depends on cloudpickle

@hiro-o918 hiro-o918 changed the title Add options to check Add options to check task definition to create an output May 2, 2021
@hiro-o918 hiro-o918 marked this pull request as ready for review May 2, 2021 03:10
@vaaaaanquish
Copy link
Contributor

@hiro-o918 Thanks great suggestions. Is it possible to apply a yapf formatter?

@vaaaaanquish
Copy link
Contributor

LGTM. I'll wait for the @Hi-king review.

@mski-iksm
Copy link
Contributor

@hiro-o918
LGTM! Thank you for your contribution!

Copy link
Collaborator

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your great contribution!

@@ -316,7 +339,7 @@ def test_add_configuration(self, mock_config: MagicMock):
self.assertEqual(True, kwargs['bool_param'])

@patch('luigi.cmdline_parser.CmdlineParser.get_instance')
def test_add_cofigureation_evaluation_order(self, mock_cmdline: MagicMock):
def test_add_configuration_evaluation_order(self, mock_cmdline: MagicMock):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -369,7 +392,7 @@ def test_load_index_only_dataframe(self):
task = _DummyTask()
task.load = MagicMock(return_value=pd.DataFrame(index=range(3)))

# connnot load index only frame with required_columns
# cannot load index only frame with required_columns
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Hi-king
Copy link
Member

Hi-king commented May 7, 2021

Cool solution! For workaround, currently we're using __version=IntParameter(default=2) for declaring the change of task definition 💦 This way looks more sophisticated to me !

@Hi-king Hi-king merged commit d5e55f4 into m3dev:master May 7, 2021
@hiro-o918
Copy link
Contributor Author

Thank you for your fast your reviews! 🚀

@hirosassa
Copy link
Collaborator

@hiro-o918 gokart 1.0.1 including your great contribution is released. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants