You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of my team's workflow, we extensively use Papermill to run notebooks as part of our Apache Airflow pipelines. When upgrading Airflow to version 2.X.X we found that our default error handling tools were no longer providing detailed errors from our PapermIll tasks. The cause for this is that Airflow changed the way it handles errors in it's tasks. It temporarily pickles the error message, and then at a later point loads the pickled exception.
Because PapermillExecutionError is called with multiple arguments, but then only passes up a message argument to its superclass, pickle is unable to load it. See this stack overflow question/answer for a general case of this issue.
This error can be recreated with this simple test:
import tempfile
import pickle
from papermill.exceptions import PapermillExecutionError
def test_exceptions_are_unpickleable():
"""Ensure exceptions can be unpickled"""
temp_file = NamedTemporaryFile()
err = PapermillExecutionError(1,2, "TestSource", "Exception", Exception(), ["Traceback", "message"])
with open(temp_file.name, 'wb') as fd:
pickle.dump(err, fd)
# Read the Pickled File
temp_file.seek(0)
data = temp_file.read()
pickled_err = pickle.loads(data)
assert str(pickled_err) == str(err)
The text was updated successfully, but these errors were encountered:
馃悰 Bug
As part of my team's workflow, we extensively use Papermill to run notebooks as part of our Apache Airflow pipelines. When upgrading Airflow to version 2.X.X we found that our default error handling tools were no longer providing detailed errors from our PapermIll tasks. The cause for this is that Airflow changed the way it handles errors in it's tasks. It temporarily pickles the error message, and then at a later point loads the pickled exception.
Because PapermillExecutionError is called with multiple arguments, but then only passes up a message argument to its superclass, pickle is unable to load it. See this stack overflow question/answer for a general case of this issue.
This error can be recreated with this simple test:
The text was updated successfully, but these errors were encountered: