Skip to content

Fix #1052: replace pydotplus with pydot in uplift_tree_plot - #1053

Merged
jeongyoonlee merged 1 commit into
masterfrom
fix/pydot-replaces-pydotplus
Oct 5, 2026
Merged

jeongyoonlee merged 1 commit into
masterfrom
fix/pydot-replaces-pydotplus

Conversation

@jeongyoonlee

Copy link
Copy Markdown
Collaborator

Closes #1052.

Master CI fails because pyparsing 3.3.3 (released 2026-09-20) breaks pydotplus's parser on the HTML-style node labels (label=<... <br/> ...>) that uplift_tree_plot writes. pydotplus 2.0.2 is its last release (2014).

Change. causalml/inference/tree/plot.py now parses the DOT string with pydot, the maintained project pydotplus was forked from; pyproject.toml swaps pydotplus for pydot>=3.0.0. pydot.graph_from_dot_data returns a list of graphs, so the function unpacks the single one. The returned pydot.Dot keeps create_png() / write_png(), which is how the docs, the example notebook and the tests use it. Changelog entry under Unreleased → Bug Fixes.

Verification (pyparsing 3.3.3, pydot 4.0.1):

  • The four failing tests (test_uplift_tree_visualization, test_kernel_uplift_tree_visualization[False|True], test_kernel_uplift_tree_plot_multi_treatment): 4 fail with master's plot.py, 4 pass with this change.
  • Full suite: 578 passed, 10 skipped.
  • pydot 3.0.0 and 2.0.0 also parse the failing label under pyparsing 3.3.3; the >=3.0.0 floor keeps the range on releases that require pyparsing 3.

🤖 Generated with Claude Code

pydotplus 2.0.2 (last release 2014) raises TypeError parsing HTML-style
node labels under pyparsing 3.3.3, which breaks uplift_tree_plot and
four visualization tests on master CI. pydot is the maintained project
pydotplus forked from and parses the same DOT string.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jeongyoonlee jeongyoonlee added the dependencies Pull requests that update a dependency file label Oct 4, 2026
@jeongyoonlee
jeongyoonlee merged commit 49283de into master Oct 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uplift_tree_plot fails with pyparsing 3.3.3: pydotplus parser TypeError (master CI red)

2 participants