◐ Shell
clean mode source ↗

fix: Remove global warning format side effect by emmanuel-ferdman · Pull Request #5481 · plotly/plotly.py

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Merged

emilykl

merged 2 commits into

Feb 16, 2026

Conversation

@emmanuel-ferdman

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>

@camdecoster

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

emilykl

Choose a reason for hiding this comment

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

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.

@emilykl

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