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

Skip black formatting if it encounters an AttributeError #699

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions papermill/translators.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@
content = black.format_str(content, mode=fm)
except ImportError:
logger.debug("Black is not installed, parameters won't be formatted")
except AttributeError as aerr:
logger.warning(f"Black encountered an error, skipping formatting ({aerr})")

Check warning on line 198 in papermill/translators.py

View check run for this annotation

Codecov / codecov/patch

papermill/translators.py#L197-L198

Added lines #L197 - L198 were not covered by tests
return content

@classmethod
Expand Down