Hey all I have one more doubt about Hooks. I have...
# questions
t
Hey all I have one more doubt about Hooks. I have a use case where I am tracking the performance metric of nodes using the before and after-run hooks. I was able to implement the logic, and it's working fine as expected. Now, I need to ensure that it will execute only in certain environments (such as production environments like Databricks, Azure, AWS, and so on), and not on local runs.
d
so there are two options that come to mind: • You can use the
env
attribute of the hook spec so that when you do
kedro run --env prod
you can intercept this • The other more option is to maintain a list of environment variables present in those systems like
DATABRICKS_RUNTIME_VERSION
t
but it is available only for pipeline hooks right !!!
d
the env attribute? which hooks are you using
t
before and after node run
d
gotcha
image.png
🥳 1
the trick is to use class state