Hello, good afternoon, I was adding a catalog item...
# questions
j
Hello, good afternoon, I was adding a catalog item from a database that has timeseries data and I wanted to have a dynamic param so when I run the code It retrieves the data regarding a certain day. I ran into this post: https://github.com/kedro-org/kedro/issues/1089 But I am failing to understand what is the reasoning behind. I would like to understand what would be the approach in kedro. Loading the whole table from sql and then run the transformations in code. But that would make quite inefficient when running in production.
d
hey this is possible, but it’s not encouraged since you lose reproducibility
but you can use templated config to have the data param in
globals.yml
you can then use a hook to inject a CLI argument into that if you really want
j
but my initial thought on this is that dynamic parameters is obtained with code with another node. Could I use the after_node_run to set this dynamic parameter in the catalog?
d
so when you get into that territory you are breaking some of Kedro’s key design decisions
because we’re striving for reproducibility we don’t like conditional logic an the nodes shouldn’t be aware of IO
it’s a tricky one because there are valid reasons users want to do this, but it’s an area Kedro has been designed to not enable
j
so the kedro approach is to have a static catalog entries
d
it was designed that way initially
now there are ways to do what you’re looking for, but it involves hooks like you say
j
thanks for the answer
It's now more clear to me