← 返回首页
fix: Remove global warning format side effect by emmanuel-ferdman · Pull Request #5481 · plotly/plotly.py · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

fix: Remove global warning format side effect#5481

Merged
emilykl merged 2 commits into
plotly:mainfrom
emmanuel-ferdman:fix-warnings-format
Feb 16, 2026
Merged

fix: Remove global warning format side effect#5481
emilykl merged 2 commits into
plotly:mainfrom
emmanuel-ferdman:fix-warnings-format

Conversation

Copy link
Copy Markdown
Contributor

Code PR

  • I have read through the contributing notes and understand the structure of the package.
  • I have added tests or modified existing tests.
  • For a new feature, I have added documentation examples (please see the doc checklist as well).
  • I have added a CHANGELOG entry if changing anything substantial.
  • For a new feature or a change in behavior, I have updated the relevant docstrings in the code.

Summary

Importing plotly.tools or plotly.offline overwrites Python's global warnings.formatwarning. This changes how all warnings look, not just plotly's. Breaks output for user code and other libraries. The custom format was added in 2014 for cosmetic reasons but the global side effect was unintended. This PR removes it because Python's default format works.

Fixes #5472
Fixes #3872

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Copy link
Copy Markdown
Contributor

Thanks for the contribution! We'll get someone on our team to review it soon.

Copy link
Copy Markdown
Contributor

emilykl left a comment

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Thanks for this change @emmanuel-ferdman ! We're not terribly attached to our custom warning format, and changing the format globally obviously isn't good behavior, so I do think the best fix here is indeed to remove the custom formatting altogether.

Copy link
Copy Markdown
Contributor

emilykl commented Feb 16, 2026

The only CI failure is the docs build which looks unrelated, so merging anyway.

Hide details View details emilykl merged commit b2fcf3b into plotly:main Feb 16, 2026
7 of 8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

[BUG]: plotly breaks warnings format Importing plotly.tools changes warnings.formatwarning as a side effect

3 participants

Footer

© 2026 GitHub, Inc.