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] Recursive default list + Package overrides #1102

Closed
ppwwyyxx opened this issue Oct 30, 2020 · 2 comments · Fixed by #1170
Closed

[Bug] Recursive default list + Package overrides #1102

ppwwyyxx opened this issue Oct 30, 2020 · 2 comments · Fixed by #1170
Labels
bug Something isn't working
Milestone

Comments

@ppwwyyxx
Copy link

🐛 Bug

Description

Recursive default List + Package overrides not working. A continuation of #171 (comment)

To reproduce

Configs:

# model/maskrcnn.yaml:
# @package _group_
a: 1
b: 2

# model/maskrcnn2.yaml:
# @package _group_
b: 3
c: 4

defaults:
  - model/maskrcnn   # ??
  - _self_

# main.yaml:
defaults:
  - [email protected]: maskrcnn2

Code:

@hydra.main(config_name="main")
def my_app(cfg: DictConfig) -> None:
    print(cfg)

if __name__ == "__main__":
    my_app()

It gives me:

{'model': {'a': 1, 'b': 2, 'submodule': {'b': 3, 'c': 4}}}

Expected Behavior

I expect to get an equivalent of

model:
  submodule:
    a: 1
    b: 3
    c: 4

System information

  • Hydra Version : master
  • Python version : 3.8.6
@ppwwyyxx ppwwyyxx added the bug Something isn't working label Oct 30, 2020
@omry
Copy link
Collaborator

omry commented Oct 30, 2020

Thanks, something is off here, will take a look.

@omry omry added this to the 1.1.0 milestone Oct 30, 2020
@omry
Copy link
Collaborator

omry commented Nov 2, 2020

This is a design issue with the current recursive defaults support.
I started to think about a design that switches addressing to be relative.
this is a very big change in how the recursive defaults will work.
Please check the design doc here and provide feedback.

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

Successfully merging a pull request may close this issue.

2 participants