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

[Bug] In some cases list with whitespace fails to parse #836

Closed
omry opened this issue Jul 29, 2020 · 6 comments
Closed

[Bug] In some cases list with whitespace fails to parse #836

omry opened this issue Jul 29, 2020 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@omry
Copy link
Collaborator

omry commented Jul 29, 2020

Example:

$ python examples/tutorials/structured_configs/1_minimal/my_app.py '+param=[[a, 1, 2], [b, 2, 3]]'
no viable alternative at input '[[a, 1, 2], [': +param=[[a, 1, 2], [b, 2, 3]]
                                                                   ^
@omry omry added the bug Something isn't working label Jul 29, 2020
@omry omry added this to the 1.0.0 milestone Jul 29, 2020
@omry omry closed this as completed Aug 11, 2020
@nehalmamgain
Copy link

nehalmamgain commented Mar 15, 2022

FYI, this issue still happens in Hydra 1.1.0

python app.py 'param=["string1", "string2"]'


  File "/usr/local/lib/python3.8/dist-packages/hydra/compose.py", line 28, in compose
    cfg = gh.hydra.compose_config(
  File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/hydra.py", line 564, in compose_config
    cfg = self.config_loader.load_configuration(
  File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/config_loader_impl.py", line 146, in load_configuration
    return self._load_configuration_impl(
  File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/config_loader_impl.py", line 231, in _load_configuration_impl
    parsed_overrides = parser.parse_overrides(overrides=overrides)
  File "/usr/local/lib/python3.8/dist-packages/hydra/core/override_parser/overrides_parser.py", line 96, in parse_overrides
    raise OverrideParseException(
hydra.errors.OverrideParseException: no viable alternative at input '["string1",'

@jieru-hu
Copy link
Contributor

hi @nehalmamgain
could you try this 'param=[string1, string2]'

more tips on how to do commandline override can be found here https://hydra.cc/docs/next/advanced/override_grammar/basic/

@nehalmamgain
Copy link

nehalmamgain commented Mar 16, 2022

@jieru-hu Hi, that results in the same error.

hydra.errors.OverrideParseException: no viable alternative at input '[string1,'

'param=["string1","string2"]' or 'param=[string1,string2]' (without whitespace) works.

@jieru-hu
Copy link
Contributor

thanks for trying it out @nehalmamgain
i'd suggest checking out the debugging tips in the doc I linked above. this is highly shell dependent.

@nehalmamgain
Copy link

@jieru-hu Thanks! I don't think the override or debugging section covers (removal of) whitespaces though.
I feel like this GH issue might be the only way for struggling users to find out.

@benrhodes26
Copy link

benrhodes26 commented Jun 25, 2023

Bump. I hit this same error, and it's hard to avoid in my case as the hydra override is auto-generated (by weights and biases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants