https://prefect.io logo
Title
b

Beibei

07/13/2020, 7:25 AM
Hi All! I am trying to use Parameters / Context to control two of my tasks in one Flow. At first to try, I wrote two command lines to get Parameters, e.g.
a = Parameter('a', default=1)
b = Parameter('b', default=2)
In Prefect API, I only see one Parameter for
b
. Did I miss something? If I need to use multiple controls for different arguments in functions, which one do you suggest me to use, Parameter or Context?
j

josh

07/13/2020, 12:52 PM
Hi @Beibei is there any chance that your parameter
a
is not being used in the flow? Could you share some example code of what you are trying?
b

Beibei

07/13/2020, 1:26 PM
Hi @josh Thanks a lot for reminding. Your guess was right. I did pass it to an extra function but didn't really use it...My mistake. you 💯
@josh Do you have any suggestions on when to use Parameters and when to use Context?
j

josh

07/13/2020, 1:44 PM
Eh it’s kind of up to personal preference but I personally would use Parameters at all opportunities over Context. Mainly because parameters are more “first class” in a way where they are actual prefect tasks in the flow
:upvote: 1