How does one add a new Parameter to an existing Fl...
# prefect-community
b
How does one add a new Parameter to an existing Flow? I inherited a Flow from a colleague that has since left and I wish to add a new Parameter
Copy code
with Flow("HathiTrust Deposit (MARCXML)") as flow:    
     deposit = Parameter("deposit", default=False)
This is the existing parameter. I want to add a second so naturally I tried adding another underneath the first like this:
Copy code
with Flow("HathiTrust Deposit (MARCXML)") as flow:  
    deposit = Parameter("deposit", default=False)
    local_test = Parameter("local_test", default=False)
This results in an error:
Copy code
UserWarning: Tasks were created but not added to the flow: {<Parameter: local_test>}. This can occur when `Task` classes, including `Parameters`, are instantiated inside a `with flow
How does one add a parameter to an existing flow?
j
Hi Brandon, you added the parameter correctly. That warning occurs when you define a parameter, but don't use that parameter in your flow
b
It is in use or do you mean as a parameter to a Task?
j
If you call a task and pass in the parameter it should resolve that error
b
I'll give that a shot. Thanks!
👍 1
That was it! Thanks James!
🎉 1