We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Describe the bug parsing dataclasses with Tuple[Tuple[int, int],...] raises validation errors in 2.0.6 and very strange traceback in 2.1.0
To Reproduce
This will give you an error.
from typing import Tuple, Any import dataclasses import pydantic from omegaconf import OmegaConf @pydantic.dataclasses.dataclass class Person: favorite_dates: Tuple[Tuple[int,int], ...] = ((11, 1999), (1, 1995)) @pydantic.dataclasses.dataclass class SimpleTypes: num: int = 10 pi: float = 3.1415 is_awesome: bool = True description: str = "text" person: Person = Person() OmegaConf.structured(SimpleTypes)
in omegaconf==2.0.6 the error makes sense
ValidationError: Unsupported value type : typing.Tuple[int, int] full_key: reference_type=None object_type=None
in omegaconf=2.1.0 the error does not make any sense :)
the fix is a bit hacky. I need to define the field as Any
from typing import Tuple, Any import dataclasses import pydantic from omegaconf import OmegaConf @pydantic.dataclasses.dataclass class Person: favorite_dates: Tuple[Any, ...] = ((11, 1999), (1, 1995)) @pydantic.dataclasses.dataclass class SimpleTypes: num: int = 10 pi: float = 3.1415 is_awesome: bool = True description: str = "text" person: Person = Person() OmegaConf.structured(SimpleTypes)
Expected behavior
The code above it should just work
Additional context
The text was updated successfully, but these errors were encountered:
Hi, Thanks for reporting.
The AssertionError in 2.1 is planned to be replaced with a more helpful ValidationError in PR #749.
AssertionError
ValidationError
FYI Tuple support in OmegaConf is currently limited (and undocumented!) This is an area that is planned for future improvement (reference issue: #392)
Tuple
Also, nesting container types (e.g. dict-of-dict or list-of-list or dict-of-tuple-of-list) is not yet supported (reference issue: #427).
I'm closing this in favor of the above mentioned issues.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
parsing dataclasses with Tuple[Tuple[int, int],...] raises validation errors in 2.0.6 and very strange traceback in 2.1.0
To Reproduce
This will give you an error.
in omegaconf==2.0.6 the error makes sense
in omegaconf=2.1.0 the error does not make any sense :)
the fix is a bit hacky. I need to define the field as Any
Expected behavior
The code above it should just work
Additional context
The text was updated successfully, but these errors were encountered: