Skip to content

refactor(config): use pydantic for config classes#2936

Draft
sylvlecl wants to merge 1 commit intodevfrom
pydantic-config
Draft

refactor(config): use pydantic for config classes#2936
sylvlecl wants to merge 1 commit intodevfrom
pydantic-config

Conversation

@sylvlecl
Copy link
Member

@sylvlecl sylvlecl commented Jan 19, 2026

AI generated so far, to be checked, cleaned up, improved

Signed-off-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
model_config = ConfigDict(
frozen=True,
populate_by_name=True,
extra="ignore",
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think we should ignore

filter_out: List[str] = field(default_factory=lambda: [])
groups: List[str] = field(default_factory=lambda: [])
# Handle jwt.key -> jwt_key
if "jwt" in data and isinstance(data["jwt"], dict):
Copy link
Member Author

Choose a reason for hiding this comment

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

might be possible to have a util function for this

"""Convert dict entries to WorkspaceConfig objects."""
if isinstance(v, dict):
return {
key: WorkspaceConfig.model_validate(val) if isinstance(val, dict) else val for key, val in v.items()
Copy link
Member Author

Choose a reason for hiding this comment

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

typing issue to be fixed

@TheoPascoli TheoPascoli force-pushed the dev branch 2 times, most recently from b96b4f5 to 86503ca Compare February 20, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant