Thread
#prefect-community
    a

    Abhas P

    1 year ago
    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 ?
    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?
    Kevin Kho

    Kevin Kho

    1 year ago
    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

    Abhas P

    1 year ago
    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.
    Kevin Kho

    Kevin Kho

    1 year ago
    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

    Abhas P

    1 year ago
    Should I post the example on the github thread or here ?
    Kevin Kho

    Kevin Kho

    1 year ago
    github thread is good if you have a small one 🙂
    a

    Abhas P

    1 year ago
    Just did !
    Kevin Kho

    Kevin Kho

    1 year ago
    Thank you! I really don’t know what is going on with that issue to be honest