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] Misleading overriding behavior for "empty" (null) keys #2958

Open
2 tasks done
YodaEmbedding opened this issue Sep 18, 2024 · 0 comments
Open
2 tasks done

[Bug] Misleading overriding behavior for "empty" (null) keys #2958

YodaEmbedding opened this issue Sep 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@YodaEmbedding
Copy link

YodaEmbedding commented Sep 18, 2024

🐛 Bug

Description

Input:

# dataset/imagenet.yaml

type: "ImageNetDataset"
path: "/datasets/imagenet"
# example.yaml

defaults:
  - dataset/imagenet
  - _self_

dataset:
  type: "Overriden"

Output (as expected):

dataset:
  type: 'Overriden'
  path: '/datasets/imagenet'

However, if we change example.yaml to:

# example.yaml

defaults:
  - dataset/imagenet
  - _self_

dataset:

Output (unexpected, but correct):

dataset: null

The intuitive expected output would have been:

dataset:
  type: 'ImageNetDataset'
  path: '/datasets/imagenet'

Checklist

  • I checked on the latest version of Hydra
  • I created a minimal repro (See this for tips).

To reproduce

See above.

Expected Behavior

When overriding existing dicts with a single null value, hydra could perhaps produce a warning.

System information

  • Hydra Version : 1.3.2
  • Python version : 3.11.9
  • Virtual environment type and version : user
  • Operating system : MacOS

Additional context

@YodaEmbedding YodaEmbedding added the bug Something isn't working label Sep 18, 2024
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

1 participant