You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hamilton.apache.org by "TyraNyamburaa (via GitHub)" <gi...@apache.org> on 2026/09/22 15:51:59 UTC
[PR] feat: enhance graph node classification and add custom style function… [hamilton]
TyraNyamburaa opened a new pull request, #1722:
URL: https://github.com/apache/hamilton/pull/1722
… test
<!-- SPDX-License-Identifier: Apache-2.0 -->
--- PR TEMPLATE INSTRUCTIONS (1) ---
Looking to submit a Apache Hamilton Dataflow to the apache-hamilton-contrib module? If so go the the `Preview` tab and select the appropriate sub-template:
* [apache-hamilton-contrib template](?expand=1&template=HAMILTON_CONTRIB_PR_TEMPLATE.md)
Else, if not, please remove this block of text.
--- PR TEMPLATE INSTRUCTIONS (2) ---
Fix Issue #1307: custom_style_function now receives explicit "input" and "output" node_class values instead of defaulting everything to "function".
## Changes
- **hamilton/graph.py**:
- Added "output" node type detection in `_get_node_type()` - identifies terminal nodes (nodes with originating functions but no dependents)
- Fixed `custom_style_function` to be called for input nodes (was previously skipped with `continue`)
- Updated fallback style comment to include "output" type
- **tests/test_graph.py**:
- Added `test_custom_style_function_receives_input_and_output_classes()` to validate the fix
## How I tested this
- Ran new test: `pytest tests/test_graph.py::test_custom_style_function_receives_input_and_output_classes -v` ✓
- Ran all graph tests: `pytest tests/test_graph.py -v` → 106 passed, 5 failed (Graphviz not installed, not related to changes)
- Ran pre-commit hooks: `prek run --all-files` ✓
## Notes
This resolves Issue #1307 by ensuring `custom_style_function` receives proper `node_class` values:
- `"input"` for external input nodes
- `"output"` for terminal output nodes (new)
- `"config"` for config nodes
- `"function"` for intermediate function nodes
## Checklist
- [x] PR has an informative and human-readable title (this will be pulled into the release notes)
- [x] Changes are limited to a single goal (no scope creep)
- [x] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
- [x] Any _change_ in functionality is tested
- [x] New functions are documented (with a description, list of inputs, and expected output)
- [x] Placeholder code is flagged / future TODOs are captured in comments
- [x] Project documentation has been updated if adding/changing functionality.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org