Skip to content

Preserve dataclass and attrs call-site arguments#3316

Merged
omry merged 1 commit into
mainfrom
pr3316
Jul 25, 2026
Merged

Preserve dataclass and attrs call-site arguments#3316
omry merged 1 commit into
mainfrom
pr3316

Conversation

@omry

@omry omry commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Pass already-constructed dataclass and attrs instances to instantiate targets unchanged instead of implicitly converting them to Structured Configs.

Keep native and explicit OmegaConf containers on the configuration path. Add regression coverage for identity passthrough, special constructors, attrs, and explicit structured overrides.

Document the Hydra 1.4 breaking change and migration, and add attrs to the test environments.

Closes #2364

Copilot AI review requested due to automatic review settings July 25, 2026 11:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@meta-cla meta-cla 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 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 353e602c9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +494 to +495
Dataclass and attrs instances are passed through without
conversion or recursive instantiation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve structured container subclasses too

When a dataclass or attrs instance subclasses dict or list, _prepare_input_value() still recognizes it via isinstance() and recursively converts it into a plain container before override processing, so the target does not receive the original object as promised here. This affects valid structured runtime objects such as @dataclass class RuntimeDict(dict); exclude structured instances from native-container normalization or restrict that normalization to exact built-in container types.

Useful? React with 👍 / 👎.

Pass already-constructed dataclass and attrs instances to instantiate targets unchanged instead of implicitly converting them to Structured Configs.

Keep native and explicit OmegaConf containers on the configuration path. Add regression coverage for identity passthrough, special constructors, attrs, and explicit structured overrides.

Document the Hydra 1.4 breaking change and migration, and add attrs to the test environments.

Closes #2364

omry commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 9ec0b6f98f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@omry
omry merged commit 44e1695 into main Jul 25, 2026
25 checks passed
@omry
omry deleted the pr3316 branch July 25, 2026 12:58
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.

[Feature Request] Preserve dataclasses as instantiate-arguments

2 participants