Skip to content

Fix collect visualization edge styling#1651

Merged
jernejfrank merged 1 commit into
apache:mainfrom
Probablism:fix-collect-visualization-edges
Jul 2, 2026
Merged

Fix collect visualization edge styling#1651
jernejfrank merged 1 commit into
apache:mainfrom
Probablism:fix-collect-visualization-edges

Conversation

@Probablism

Copy link
Copy Markdown
Contributor

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
@jernejfrank

Copy link
Copy Markdown
Contributor

Could you post a screen shot of a dag please

@Probablism

Copy link
Copy Markdown
Contributor Author

sure

screenshot

@jernejfrank jernejfrank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

@jernejfrank jernejfrank force-pushed the fix-collect-visualization-edges branch from f67570d to 7e4134d Compare July 2, 2026 10:09
@jernejfrank jernejfrank merged commit 5e5a449 into apache:main Jul 2, 2026
6 checks passed
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

2 participants