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

Expanding instructions for list CLI override #834

Closed
wants to merge 1 commit into from
Closed

Expanding instructions for list CLI override #834

wants to merge 1 commit into from

Conversation

rohitgirdhar
Copy link

Motivation

I just spent a bunch of time debugging a command line override that involved nested lists (something like param='[["a", 1, 2], ["b", 2, 3]]', which gave me a hydra.errors.OverrideParseException: no viable alternative at input error until I removed the space between the 2 sublists. So this tip might help future users.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Not needed

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 29, 2020
@omry
Copy link
Collaborator

omry commented Jul 29, 2020

Thanks for reporting @rohitgirdhar.
Please file issues for discussion before sending pull request.
In this case this is actually a bug, not a documentation issue.

@omry omry closed this Jul 29, 2020
@omry
Copy link
Collaborator

omry commented Jul 29, 2020

#836

@omry
Copy link
Collaborator

omry commented Jul 29, 2020

This is not a list, it's a quoted string that looks like one.

param='[["a", 1, 2], ["b", 2, 3]]'

This is a bit confusing because both Hydra and the shell and using quotes.

This is the correct form:

'param=[[a, 1, 2], [b, 2, 3]]'

The quotes here are for the shell, to make sure it sends this as a single command line argument.
Note that you don't need to quote a and b, This is not JSON.
I have a fix coming for this issue as a part of a bigger change to the grammar (#752).

@omry
Copy link
Collaborator

omry commented Jul 29, 2020

This is actually a list, but the way you present it confused even me :).

You can tell what the shell will send to Hydra using echo:

$ echo param='[["a", 1, 2], ["b", 2, 3]]'
param=[["a", 1, 2], ["b", 2, 3]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants