Skip to content

Display config on visualization#833

Merged
skrawcz merged 2 commits intomainfrom
feat/display-config
Apr 22, 2024
Merged

Display config on visualization#833
skrawcz merged 2 commits intomainfrom
feat/display-config

Conversation

@zilto
Copy link
Contributor

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

2 participants