analyze: add --show-path flag + Bottleneck column#4
Merged
Conversation
Two additions to `analyze`'s table output: 1. `--show-path` flag renders the full chain of node ids for each longest path (previously only source and end were shown). 2. A Bottleneck column names the slowest model on each path and its execution time. Directly answers "which model should I optimize first" — the bottleneck on the #1 path is the first-order target. When the same bottleneck appears across multiple rows it's a shared upstream that several paths depend on; optimizing it benefits all of them (shared-node leverage). The weights are threaded through via the existing Dag; no new data collection. JSON / JSONL outputs are unchanged — they already carry the full path, and adding a redundant bottleneck field would duplicate information derivable from path + weights. Tests: 4 new (2 formatter, 2 CLI). Suite: 46 passing. Co-Authored-By: Claude Opus 4.7 (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.
Summary
Two additions to
analyze's table output to answer the question "which model should I actually optimize?":--show-pathflag renders the full chain of node ids for each longest path. Default output is unchanged (source + end of path).Bottleneckcolumn names the slowest model on each path and its execution time. The bottleneck on the Rewrite as production-ready Python package (v0.1.0 on PyPI) #1 row is the first-order optimization target. When the same bottleneck repeats across multiple rows, that's shared-node leverage — one upstream that several paths depend on.Observed against the dbt_dugout fixture:
fct_player_salariesis the bottleneck on 3 of the top 4 paths.Design notes
Dag; no new data collection.path + weights.whatifsimulator, not the static analyzer.Test plan
pytest— 46 passed (4 new; 42 pre-existing)ruff check .+mypy src— cleantests/fixtures/dbt_dugout/in both default and--show-pathmodes.🤖 Generated with Claude Code