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

fix: task status issue with unpicklable artifacts #2087

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

saikonen
Copy link
Collaborator

@saikonen saikonen commented Oct 8, 2024

if a flow contains unpicklable artifacts, the task status for such a step is recorded as successful even though pickling fails and leads to a non-zero exit for the task.

example:

from metaflow import FlowSpec, step, kubernetes

class DemoFlow(FlowSpec):

    @kubernetes
    @step
    def start(self):
        self.x = open("hello.txt", "w")
        self.next(self.end)

    @step
    def end(self):
        pass

if __name__ == "__main__":
    DemoFlow()

# persisting might fail due to unpicklable artifacts.
output.persist(self.flow)
except Exception as ex:
self.flow._task_ok = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add self.flow._exception = MetaflowExceptionWrapper(ex) here as well. Maybe a print statement as well.

Copy link
Collaborator Author

@saikonen saikonen Oct 11, 2024

Choose a reason for hiding this comment

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

what is the retained exception used for internally? I'm also not sure if adding a print will help in this case.

edit: re-raising the error correctly produces stderr that ends in task logs, so the user has an idea what went wrong with the flow

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.

2 participants