m

    Manuel Aristarán

    2 years ago
    this is the result of print(f.parameters()):
    {<Parameter: tap_catalog>, <Parameter: tap_config>}
    j

    josh

    2 years ago
    Not entirely sure what’s going on here at first glance but I can say flows definitely accept an arbitrary number of parameters 🙂
    In [18]: @task
        ...: def vals(x1, x2, x3):
        ...:     print(x1, x2, x3)
        ...:
    
    In [19]: with Flow('test') as flow:
        ...:     p1 = Parameter('p1')
        ...:     p2 = Parameter('p2')
        ...:     p3 = Parameter('p3')
        ...:     vals(p1, p2, p3)
        ...:
    
    In [20]: flow.parameters()
    Out[20]: {<Parameter: p1>, <Parameter: p2>, <Parameter: p3>}
    It’s almost like
    target_config
    isn’t being picked up on
    run_cassandra_target
    🤔 what happens when you run the flow?
    Here’s a setup similar to yours and I am getting the proper amount of parameters on the flow:
    In [23]: @task
        ...: def take_two(x, y):
        ...:     return x + y
        ...:
    
    In [24]: @task
        ...: def take_res_and_param(param, res):
        ...:     print(param + res)
        ...:
    
    In [25]: with Flow('test') as flow:
        ...:     p1 = Parameter('p1')
        ...:     p2 = Parameter('p2')
        ...:     p3 = Parameter('p3')
        ...:     res = take_two(p1, p2)
        ...:     take_res_and_param(p3, res)
        ...:
        ...:
    
    In [26]: flow.parameters()
    Out[26]: {<Parameter: p1>, <Parameter: p2>, <Parameter: p3>}
    m

    Manuel Aristarán

    2 years ago
    ARGH 😬 Forgot to decorate
    run_cassandra_target
    with
    @task
    (it’s my first stab at a Flow, sorry ab that)
    j

    josh

    2 years ago
    No problem! Glad you got it sorted out