Hey everyone,
I was wondering if there was a way to do the node declaration as follows:pipelines/data.py
@node(inputs=..., outputs=...) def preprocess(...): ...The reason why i ask is because my nodes are growing and it is becoming a bit tiring to go import my function, do the kedro wiring and occasionally I have typos as i forgot about the function signature. Something like this would be quite nice to declare.
you can implement your own in 2 lines of code https://github.com/kedro-org/kedro/issues/2471#issuecomment-1525734095
Thanks for the link. Useful read. I was wondering if this would make my functions work as normal if i am not using kedro. For instance, if i run a unit test on the function or import into a notebook and try to play with it? Current trick just returns a node object if im not missing anything?
yeah that's the tradeoff of using such decorator indeed. if you wanted to test them or play interactively with them, you'd need to access the underlying undecorated function. maybe using functools.wraps
would do the trick.
it's the reason why we don't promote that syntax though