Skip to content

Fix Inspector styled table with pandas 3 (applymap removed) - #23690

Open
u7k4rs6 wants to merge 1 commit into
pytorch:mainfrom
u7k4rs6:fix-inspector-styler-map
Open

u7k4rs6 wants to merge 1 commit into
pytorch:mainfrom
u7k4rs6:fix-inspector-styler-map

Conversation

@u7k4rs6

@u7k4rs6 u7k4rs6 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

display_or_print_df styles the dataframe with df.style.applymap(...). Styler.applymap was deprecated in pandas 2.1 and removed in pandas 3.0, so with pandas 3 that line raises an AttributeError. The bare except around it swallows the error and falls back to the plain-text tabulate print, so in a notebook print_data_tabular() silently stops showing the styled table, no error anywhere.

The fix is just applymap -> map. Styler.map exists since pandas 2.1 and the repo already needs pandas>=2.2.2, so nothing else changes.

Test plan

Added test_display_or_print_df_in_ipython in devtools/inspector/tests/inspector_utils_test.py. It fakes the IPython modules, turns FutureWarning into an error (so it also catches the deprecated call on pandas 2.x), and checks the styled table goes to display() and nothing is printed. It fails on main and passes with the fix on pandas 3.0.6, and the rest of inspector_utils_test.py passes (93 tests). ufmt and flake8 are clean with the versions in requirements-lintrunner.txt.

cc @nil-is-all

@u7k4rs6
u7k4rs6 requested a review from Gasoonjia as a code owner October 11, 2026 18:21
Copilot AI balanced review requested due to automatic review settings October 11, 2026 18:21
@pytorch-bot

pytorch-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23690

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 15 Awaiting Approval

As of commit 4dfeb50 with merge base f2575be (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 11, 2026

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@u7k4rs6

u7k4rs6 commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: devtools"

@pytorch-bot pytorch-bot Bot added the release notes: devtools Changes to dev tooling, for example the debugger & profiler label Oct 11, 2026
@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Oct 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. community: contribution PRs coming from community (excluding hardware partners) release notes: devtools Changes to dev tooling, for example the debugger & profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants