feat(treeplot): lay out the tree without igraph - #7984
Open
kz930 wants to merge 1 commit into
Open
Conversation
The generated template imported igraph, which no requirements file declares, so the operator failed with No module named 'igraph' on any environment built from the repository. Declaring it is not open to us. igraph is GPL v2, which is Category X under the ASF 3rd party license policy, and check_binary_deps.py rejects it. igraph did four things here: build a graph from the pairs, read the node names back, run the Reingold-Tilford layout, and return the edge list. Only the layout does real work, and EdgeSeq was imported but never used. The template now computes the layout itself. Depth picks the row, a leaf takes the next free column, and a parent sits centred over its children. Roots are the nodes that never appear as a child, and anything left over sits in a cycle no root reaches, so every node is placed exactly once. The tree keeps its shape. Spacing is uniform per leaf rather than Reingold-Tilford's contour packing, so an unbalanced tree draws slightly wider than it did. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7984 +/- ##
=========================================
Coverage 93.14% 93.14%
+ Complexity 4654 4653 -1
=========================================
Files 1174 1174
Lines 47580 47580
Branches 5316 5316
=========================================
Hits 44318 44318
Misses 1785 1785
Partials 1477 1477
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 413 | 0.252 | 22,856/41,434/41,434 us | 🔴 +38.7% / 🔴 +204.6% |
| ⚪ | bs=100 sw=10 sl=64 | 953 | 0.581 | 104,101/134,937/134,937 us | ⚪ within ±5% / 🔴 +47.3% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,117 | 0.681 | 892,749/957,952/957,952 us | ⚪ within ±5% / 🔴 +8.7% |
Baseline details
Latest main 7fbf64e from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 413 tuples/sec | 460 tuples/sec | 908.02 tuples/sec | -10.2% | -54.5% |
| bs=10 sw=10 sl=64 | MB/s | 0.252 MB/s | 0.281 MB/s | 0.554 MB/s | -10.3% | -54.5% |
| bs=10 sw=10 sl=64 | p50 | 22,856 us | 21,071 us | 10,907 us | +8.5% | +109.6% |
| bs=10 sw=10 sl=64 | p95 | 41,434 us | 29,868 us | 13,604 us | +38.7% | +204.6% |
| bs=10 sw=10 sl=64 | p99 | 41,434 us | 29,868 us | 16,697 us | +38.7% | +148.2% |
| bs=100 sw=10 sl=64 | throughput | 953 tuples/sec | 963 tuples/sec | 1,188 tuples/sec | -1.0% | -19.8% |
| bs=100 sw=10 sl=64 | MB/s | 0.581 MB/s | 0.588 MB/s | 0.725 MB/s | -1.2% | -19.8% |
| bs=100 sw=10 sl=64 | p50 | 104,101 us | 102,305 us | 85,003 us | +1.8% | +22.5% |
| bs=100 sw=10 sl=64 | p95 | 134,937 us | 133,478 us | 91,599 us | +1.1% | +47.3% |
| bs=100 sw=10 sl=64 | p99 | 134,937 us | 133,478 us | 99,202 us | +1.1% | +36.0% |
| bs=1000 sw=10 sl=64 | throughput | 1,117 tuples/sec | 1,121 tuples/sec | 1,221 tuples/sec | -0.4% | -8.5% |
| bs=1000 sw=10 sl=64 | MB/s | 0.681 MB/s | 0.684 MB/s | 0.745 MB/s | -0.4% | -8.6% |
| bs=1000 sw=10 sl=64 | p50 | 892,749 us | 881,704 us | 837,593 us | +1.3% | +6.6% |
| bs=1000 sw=10 sl=64 | p95 | 957,952 us | 933,809 us | 881,015 us | +2.6% | +8.7% |
| bs=1000 sw=10 sl=64 | p99 | 957,952 us | 933,809 us | 915,550 us | +2.6% | +4.6% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,484.64,200,128000,413,0.252,22856.32,41434.31,41434.31
1,100,10,64,20,2099.25,2000,1280000,953,0.581,104101.26,134937.39,134937.39
2,1000,10,64,20,17912.45,20000,12800000,1117,0.681,892749.34,957952.13,957952.13
Contributor
Author
|
/request-review @aglinxinyuan @carloea2 |
kz930
added a commit
to Nicoleee1108/texera_workflow_to_py
that referenced
this pull request
Aug 26, 2026
The generated template imported igraph, which no requirements file declares, so the operator failed with No module named 'igraph' on any environment built from the repository. igraph is GPL v2, Category X under the ASF 3rd party license policy, so declaring it is not open to us. Both generators now compute the layout themselves. Depth picks the row, a leaf takes the next free column, and a parent sits centred over its children. Roots are the nodes that never appear as a child, and anything left over sits in a cycle no root reaches, so every node is placed exactly once. The template half is the same change as apache#7984. The standalone half has no upstream counterpart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
The Tree Plot operator's generated template no longer imports igraph. It computes its
own top-down layout instead: depth picks the row, a leaf takes the next free column,
and a parent sits centred over its children. Roots are the nodes that never appear as
a child, and anything unreachable from a root is rooted where it is, so a forest, a
cycle, a shared child and a self-loop all place every node exactly once. The walk is
iterative, so a deep tree cannot hit the recursion limit.
igraph was used for four things:
Graph.TupleList,vs['name'],layout('rt')andget_edgelist(). Only the layout did real work, andEdgeSeqwas imported but neverused. No new dependency is added.
The layout guard is kept and now reads
Tree layout failed. It earns its keep: a celllike
[[1,2], 3]parses to an unhashable node, which now renders the error pageinstead of failing the operator.
The tree keeps its shape. Spacing is uniform per leaf rather than Reingold-Tilford's
contour packing, so an unbalanced tree draws slightly wider than before.
Any related issues, documentation, discussions?
Closes #7969. Supersedes #7970, which declared igraph and was closed because GPL v2 is
Category X under the ASF 3rd party license policy.
How was this PR tested?
TreePlotOpDescSpecpasses, including a new test that the generated code does not nameigraph. I also dumped the generated template and ran it against a four-level tree with
igraph made unimportable, and it rendered the plot rather than an error page. The root
landed at 2.375 over children at 1.25 and 3.5, their children at 0.5, 2, 3 and 4, and
the deepest pair at 0 and 1. I checked a chain, a forest, a cycle, a diamond, a
self-loop and duplicate edges separately, and a 200k-node chain lays out in 0.29s.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)