Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON needs escapes for passing params in prefect run cloud #3295

Closed
zhen0 opened this issue Sep 11, 2020 · 2 comments · Fixed by #3325
Closed

JSON needs escapes for passing params in prefect run cloud #3295

zhen0 opened this issue Sep 11, 2020 · 2 comments · Fixed by #3325
Assignees
Labels
component:cli Related to the Prefect CLI docs

Comments

@zhen0
Copy link
Member

zhen0 commented Sep 11, 2020

Description

If I try to run a flow using the CLI and add params using the example in the help section (from calling prefect run cloud -h) I get an error message. For example:
prefect run cloud -n Params-New -p Jenny -ps {"c":3}
Gives the following error:
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

If I enter the params as a string with an escape round other speechmarks, it works:
For example:
prefect run cloud -n Params-New -p Jenny -ps "{\"c\":3}"
works fine

Expected Behavior

Best case scenario:
prefect run cloud -n Params-New -p Jenny -ps {"c":3} works fine.
Second best:
We update the docs to show an example with correct JSON formatting.

Reproduction

prefect run cloud -n FLOWNAME -p PROJECT -ps {"c":3}

Environment

@joshmeek joshmeek added component:cli Related to the Prefect CLI docs labels Sep 14, 2020
@cicdw
Copy link
Member

cicdw commented Sep 16, 2020

@zhen0 - if you put your parameters within single ticks it will work as you expect:

prefect run cloud -n FLOWNAME -p PROJECT -ps '{"c":3}'

you can even include spaces!

prefect run cloud -n FLOWNAME -p PROJECT -ps '{"c" : 3}'

I'll update the example documentation to clarify this point.

@zhen0
Copy link
Member Author

zhen0 commented Sep 16, 2020

Ah great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cli Related to the Prefect CLI docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants