Hi all, for a prefect flow to pass on credentials ...
# ask-community
a
Hi all, for a prefect flow to pass on credentials to the mapped tasks - can I pass a dictionary of credentials or should be split into singular values ?
Copy code
with Flow("example") as flow:

  credentials = {'id': ... , 'pass': ...}
  apply_map(transform ,result ,unmapped(credentials)) # can we do this ?
  apply_map(transform ,result ,id =unmapped(credentials['id']), pass =unmapped(credentials['pass'])) # or is this the standard way?
k
I believe
unmapped
will work for you and that is the standard way. No need to split out credentials, at that point I think it depends on what your function takes but both will work
a
sending credentials as a dictionary causes :
raise ValueError("Cycle found; flows must be acyclic!")
which kinda surprised me. So I stuck to sending the creds as individual unmapped params.
k
Oh I just noticed you had the apply_map. If would help us if you could give a simple example because there is an issue here
a
Should I post the example on the github thread or here ?
k
github thread is good if you have a small one 🙂
a
Just did !
k
Thank you! I really don’t know what is going on with that issue to be honest