Hook to apply decorators
See original GitHub issueDescription
Hook to apply decorators
Context
Decorators are useful to modify behaviors of multiple node functions.
Kedro 0.18.0 will deprecate applying decorators by decorate method of kedro.pipeline.Pipeline and it is encouraged to use hooks to apply decorators, but there are no official hooks to apply decorators.
Possible Implementation
Provide hooks to apply decorators
Possible Alternatives
Continue to support decorators by kedro.pipeline.Pipeline even in Kedro 0.18.0 and later.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Decorators vs Hooks - Procore
With Hook. With the hook, it is easy to use multiple copies of the same piece of state, in this case, Visibility. However,...
Read more >Decorating React hook with Typescript - DEV Community
In this tutorial we'll see how a React hook can be decorated using a higher order function and even have its return type...
Read more >Primer on Python Decorators
In this introductory tutorial, we'll look at what Python decorators are and how to create and use them.
Read more >18 in. White Snap Install Hook Rack with 4 Satin Nickel Pill ...
The Home Decorators Collection 18 inch white SNAP hook rack with satin nickel pill top hooks is a stylish rack that conceals the...
Read more >Before Hooks - The Falcon Web Framework - Read the Docs
Falcon supports before and after hooks. You install a hook simply by applying one of the decorators below, either to an individual responder...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If you prefer chaining decorators together like in the existing
Node.decoratenotation, then you should be able to write a small helper function to do this. Something like:This should achieve
node.func = deco1(deco2(deco3(node.func)))without needing to explicitly do the nesting.Thanks @AntonyMilneQB . Yes, using decorators as functions like
node.func = log_time(node.func)seems to work fine. To use multiple decorators, however, the decorators need to be nested likenode.func = deco1(deco2(deco3(node.func))), and it doesn’t look like Kedro’s style though. Anyway, thanks for a workable suggestion!