Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display config on visualization #833

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Display config on visualization #833

merged 2 commits into from
Apr 22, 2024

Conversation

zilto
Copy link
Collaborator

@zilto zilto commented Apr 22, 2024

Visualizations now display the config value instead of type Any. Also, nodes affected by configuration have the suffix node_name: config_key.

all

While working on this feature, I realized all high-level viz function except display_all_functions() failed to show config nodes (#832). This is because it's the only function to pass the config via the nodes argument (type hamilton.node.Node) while other functions first filter a path of nodes, which excludes the config.

Instead of a large refactoring, hamilton.graph.create_graphviz_graph() now has a kwarg config which raises an exception if left to None. It's the caller's responsibility to have this config match the actual config value that lead to the set of nodes passed. This unlikely to cause problem unless people dig into internal APIs.

Changes

  • added config kwarg to create_graphviz_graph() and upstream callers
  • modified to create_graphviz_graph() display config nodes
  • added tests for low-level FunctionGraph.display() and high-level Driver.display_ and Driver.visualize_
  • updated tests to use the create_graphviz_graph() config kwarg

How I tested this

Notes

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 pre-commit check & 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.

@zilto zilto added bug Something isn't working enhancement New feature or request labels Apr 22, 2024
@skrawcz skrawcz merged commit 0772e04 into main Apr 22, 2024
23 checks passed
@skrawcz skrawcz deleted the feat/display-config branch April 22, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants