Hello, I need help, when i follow this example fro...
# hamilton-help
n
Hello, I need help, when i follow this example from document https://hamilton.dagworks.io/en/latest/reference/decorators/pipe/#pipe from hamilton.function_modifiers import step, pipe, value, source def _add_one(x: int) -> int: return x + 1 def _sum(x: int, y: int) -> int: return x + y def _multiply(x: int, y: int, z: int=10) -> int: return x * y * z @pipe( step(_add_one), step(_multiply, y=2), step(_sum, y=value(3)), step(_multiply, y=source("upstream_node_to_multiply")), ) def final_result(upstream_int: int) -> int: return upstream_int however, i got error: AttributeError: 'NoneType' object has no attribute ___name_ hamilton v1.65.0 is there anyway to run this correctly, i am new to hamilton
👀 1
t
Are you running this code in a notebook?
n
yes, i run on zeppelin notebook
other decorator is fine but this got error
t
I believe I know the source of the issue. I'll go inspect. It should only affect
@pipe
In the meantime, enabling the notebook extension for Hamilton should fix the issue. Essentially, you will need to 1. Load the extension once in the notebook
Copy code
%load_ext hamilton.plugins.jupyter_magic
2. Add to the first line of the cell where
@pipe
is used
%%cell_to_module my_module
I suggest reading the beginning of the notebook extension tutorial for context
Let me know if you face other issues!
n
got it it works now when adding magic
🙌 1
thank you so much
t
Awesome! Have a nice day 🙂