Hi All! I am trying to use Parameters / Context to...
# prefect-community
b
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
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
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
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