hello, what is the best way to i access credential...
# questions
o
hello, what is the best way to i access credentials during a node run? i saw https://github.com/kedro-org/kedro/issues/575 but
get_current_session
has been deprecated for hooks
i tried to use local parameters with some success
but it broke kedro viz (characters length issues), since kedro viz reads the parameters
ok, nvm, i'll use a config loader
d
so
we intentionally make this difficult
the Nodes should be pure python functions with no knowledge of IO
credentials should be used in datasets and if you really want context and hooks
what are you trying to achieve?
o
hum, if the nodes should have pure python function then I have some issues
i have to send some data to an endpoint and get the result resulting in IO
d
a custom dataset would be the right way to do that
I think
o
hum, say for example, i have to send an image to an online processing platform
i fail to see how to implement such a dataset
d
hmmm good question
and that works by doing a
<http://requests.post|requests.post>
and then getting some response back right?
o
yes
though, it's less complicated since there are python clients that simplies formatting
d
so that doesn’t fit nicely into our load/save abstraction for our datasets
I think your current way may be best
BUT
what I’d do is a
before_pipeline_run
hook which copies the credentials to environment variable
and then I’d use that env var as the way to pick up the credentials
feels neater than loading the config loader
o
ohhhhhhhhhhhhh
yes
you've opened my eyes
it's indeed more clean
thank you
d
kedroid