Skip to content

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Mar 18, 2025

In a fdl.Config for a dataclass, when accessing a field that uses a default_factory, populate a child Config (if not already present) wrapping the default_factory call, rather than raising a "Can't get default value for dataclass field ... since it uses a default_factory" error.

This allows easy overriding of properties of child dataclasses, without requiring extra boilerplate in all parent configs to explicitly configure the defaults for child dataclasses.

@copybara-service copybara-service bot changed the title When accessing a dataclass field using a default_factory, populate a child Config or Partial wrapping the default_factory call, rather than raising "Can't get default value for dataclass field ... since it uses a default_factory" error. In a fdl.Config for a dataclass, when accessing a field that uses a default_factory, populate a child Config (if not already present) wrapping the default_factory call, rather than raising a "Can't get default value for dataclass field ... since it uses a default_factory" error. May 9, 2025
…efault_factory, populate a child Config (if not already present) wrapping the default_factory call, rather than raising a "Can't get default value for dataclass field ... since it uses a default_factory" error.

This allows easy overriding of properties of child dataclasses, without requiring extra boilerplate in all parent configs to explicitly configure the defaults for child dataclasses.

PiperOrigin-RevId: 737952148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant