Conversation
Graph.visualize() (and Application.visualize()) pass **engine_kwargs to
graphviz.Digraph, merging dict values into Burr's defaults. Only
graph_attr and node_attr have defaults, so passing any other dict such
as edge_attr={"color": "red"} raised KeyError: 'edge_attr'.
Merge into an empty dict when Burr has no default for that key.
Generated-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Application.visualize()andGraph.visualize()pass**engine_kwargsthrough tographviz.Digraph. Dict values are merged into Burr's default attributes. Onlygraph_attrandnode_attrhave defaults, so any other attribute dict fails. For example, styling edges:Changes
burr/core/graph.py: merge intodigraph_attr.setdefault(g_key, {}), so a dict kwarg with no Burr default is passed to graphviz as given.graph_attr/node_attrstill merge over Burr's defaults, as before.tests/core/test_graphviz_display.py: a regression that passesgraph_attr,node_attrandedge_attr, and checks that each reaches theDigraphwith Burr's defaults kept.How I tested this
main(8161159), the new test fails withKeyError: 'edge_attr'. With the fix, it passes.ApplicationBuilder()...build().visualize(edge_attr={"color": "red"})raisesKeyErroronmain. On this branch it returns aDigraphwithedge_attr == {"color": "red"}.pytest tests/core: 401 passed (withgraphvizinstalled).--line-length=100), isort 5.12.0 and flake8 6.1.0 at the pre-commit pins are clean on the changed files.Notes
This is a one-line change. The merge loop has been in place since f1d935b (2024-06).
Checklist
engine_kwargsis already documented as passed to the engine)AI disclosure (per the ASF Generative Tooling guidance): an AI coding tool (Claude Code, Claude Opus 5.5) wrote this change through the
breken-aiaccount. The tool found the bug, wrote the fix and the test, and wrote this description. The commit carries aGenerated-by:trailer. The diff is a small original change to existing Burr code and includes no third-party material. The red/green runs above are real, and you can re-run them from the diff. If you would rather not take AI-assisted contributions here, say so and I will close this.🤖 Generated with Claude Code