Skip to content

Fix collect visualization edge styling#1651

Open
Probablism wants to merge 1 commit into
apache:mainfrom
Probablism:fix-collect-visualization-edges
Open

Fix collect visualization edge styling#1651
Probablism wants to merge 1 commit into
apache:mainfrom
Probablism:fix-collect-visualization-edges

Conversation

@Probablism

Copy link
Copy Markdown

Fixes #556

This narrows collect edge styling in graph visualization so only the dependency annotated as Collect[...] is drawn with the collect crow-foot. Ordinary scalar inputs into the same collect node remain normal edges.

Changes

  • Apply collect edge styling only when the edge feeds the target node's actual Collect[...] dependency.
  • Keep collect node styling and expand edge styling unchanged.
  • Add a regression test for the multi-argument collect visualization case.

How I tested this

  • MPLCONFIGDIR=.mplconfig XDG_CACHE_HOME=.cache UV_CACHE_DIR=.uv-cache ./.uv-tools/bin/uv run pytest tests/test_graph.py -q
  • UV_CACHE_DIR=.uv-cache ./.uv-tools/bin/uv run ruff check hamilton/graph.py tests/test_graph.py
  • UV_CACHE_DIR=.uv-cache ./.uv-tools/bin/uv run ruff format --check hamilton/graph.py tests/test_graph.py
  • git diff --check

Notes

This is limited to visualization edge styling. It does not change dynamic execution or grouping semantics.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the focused checks listed above & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@Probablism Probablism marked this pull request as ready for review June 27, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visualization misrepresents Collect[...] nodes

1 participant