I run a prefect pipeline like this. ```prefect run...
# ask-community
s
I run a prefect pipeline like this.
Copy code
prefect run -n hello-flow --param args={'a':'alpha','b':bravo'}
Why cant i pass a dictionary to the param object instead of individual params
Copy code
Error: No such command 'args ..blah
k
This is more a limitation of command line tools that you can’t pass in Python objects as arguments and the dictionary is a Python thing, but not a command line thing.
s
so if i have 6 parameters.. then the only option is to do this 6 times in the code
Copy code
a1=Parameter(name='a1')
a2=Parameter(name='a2')
a3=Parameter(name='a3')
a4=Parameter(name='a4')
a5=Parameter(name='a5')
a6=Parameter(name='a6')
k
The parameters can take in JSON so you can try doing it that way?
s
@Kevin Kho I dont get it. We cant pass in a json in the command line tools as you mentioned before ?
k
JSON is different from dictionaries one sec let me make an example
s
kkie, i got it .. I just need to add a pair of single quotes..
Copy code
prefect run -n hello-flow --param args='{"a":"alpha","b":"bravo"}'
k
Ah ok yeah just tested it and you need to load this in as JSON and then parse it inside the flow if you have too many parameters to pass one by one