Paul D
10/14/2025, 2:32 PM@rename("My Feature")
def my_feature(...) -> ...:
return this_feature
And then node is named My Feature in the DAG, and I can further access it with source("My Feature") if needed.Seth Stokes
10/14/2025, 4:12 PM# We use @inject decorator here because we have spaces in the names of columns.
# If column names are valid python variable names we wouldn't need this.
@inject(income=source("Income"), tax_rate=source("Tax Rate"), tax_credit=source("Tax Credit"))
# Step 4: 'Tax Formula' is calculated from 'Income', 'Tax Rate' and 'Tax Credit' series
def tax_formula(income: Series, tax_rate: Series, tax_credit: Series) -> Series:Stefan Krawczyk
10/14/2025, 4:20 PMextract_fields I think --> so return a dictionary and then pull that key out...
I don't see a reason to not add @rename -- mind opening an issue / considering contributing it?
The only challenge with this is that you're forced to use @source downstream because it ceases to be a valid python variable name.Stefan Krawczyk
10/14/2025, 4:21 PMThierry Jean
10/14/2025, 5:55 PM@pipe_output we namespace things {entrypoint_node}.with_{step_node}. Similar things happen in @subdag
It creates a lot of edge cases if you can do
@rename("; DROP TABLE bar") # SQL injection
def foo(...) -> str: ...
@rename("<b><i>bingo<</b>") # valid or invalid HTML
def baz(...) -> int: ...
also:
• break graphviz notation for visualization
• Node names are used as keys in dictionaries, HamiltonGraph
• node names are passed to SQL engines in the caching backends and the Hamilton UI (would need further sanitization)
• could even break exceptions and logging message if it includes {Thierry Jean
10/14/2025, 6:02 PM"My Node!"
2. pre-graph construction hook sanitizes nodes and maps My Node! to my_node
3. error if we have name collisions (e.g., the user code has both My Node! and My Node and my_node already)
4. User can call .execute() using "My Node!" which internally maps to my_node
5. .execute() returns a dictionary {"My Node!": ...}
## Edge cases / questions
• what node_name do lifecycle hooks see? (e.g., caching, Hamilton UI, MLFlow plugin)
• we need strong assumptions and sanitation for anything internalStefan Krawczyk
10/15/2025, 12:00 AMStefan Krawczyk
10/15/2025, 12:00 AMPaul D
10/16/2025, 12:08 PMElijah Ben Izzy
10/19/2025, 4:58 PM@rename should be easyElijah Ben Izzy
10/19/2025, 4:58 PM@tag(name="My Exciting Name!")
and do the accounting yourself.