Skip to content

Ensure that patched Plotly Figure does not break pane - #8397

Merged
philippjfr merged 2 commits into
mainfrom
handle_patched_plotly
Jan 28, 2026
Merged

Ensure that patched Plotly Figure does not break pane#8397
philippjfr merged 2 commits into
mainfrom
handle_patched_plotly

Conversation

@philippjfr

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings January 28, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Plotly pane’s figure-linking logic so that it cooperates with Plotly figures that already define internal _send_* callback stubs, addressing holoviews/holoviews#6788.

Changes:

  • Refactors _update_figure to work directly with self.object as fig and to early-return for None, dict objects, unchanged figures, or when link_figure is False.
  • Switches the monkey-patching of Plotly Figure/FigureWidget message stubs (_send_addTraces_msg, _send_deleteTraces_msg, etc.) to only assign them if the attributes are not already present, avoiding overwriting existing implementations.
  • Removes the explicit dependency on plotly.graph_objs in _update_figure, relying instead on structural checks (via hasattr) rather than concrete Plotly types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread panel/pane/plotly.py
Comment thread panel/pane/plotly.py
Comment thread panel/pane/plotly.py Outdated
@codecov

codecov Bot commented Jan 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.25000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.45%. Comparing base (ff75990) to head (738d679).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
panel/pane/plotly.py 56.25% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8397      +/-   ##
==========================================
- Coverage   86.08%   85.45%   -0.64%     
==========================================
  Files         349      349              
  Lines       54835    54821      -14     
==========================================
- Hits        47205    46845     -360     
- Misses       7630     7976     +346     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@philippjfr
philippjfr merged commit 170aaee into main Jan 28, 2026
16 of 20 checks passed
@philippjfr
philippjfr deleted the handle_patched_plotly branch January 28, 2026 16:41
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scatter3D - TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union

2 participants