Skip to content

Commit

Permalink
chore: use annotations from pydantic for overrides
Browse files Browse the repository at this point in the history
IncEx is public as of pydantic 2.10
  • Loading branch information
jvansanten committed Nov 22, 2024
1 parent fecd30f commit 720e9ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ampel/base/AmpelBaseModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import warnings
from types import UnionType
from typing import TYPE_CHECKING, Any, TypeAlias, Union, get_args, get_origin
from typing import TYPE_CHECKING, Any, Union, get_args, get_origin

from pydantic import BaseModel

Expand All @@ -19,7 +19,7 @@
from pydantic._internal._generics import get_origin as _internal_get_origin

if TYPE_CHECKING:
IncEx: TypeAlias = 'set[int] | set[str] | dict[int, Any] | dict[str, Any] | None'
from pydantic.main import IncEx

NoneType = type(None)

Expand Down Expand Up @@ -84,8 +84,8 @@ def get_model_keys(cls) -> set[str]:
def dict(
self,
*,
include: "IncEx" = None,
exclude: "IncEx" = None,
include: "IncEx | None" = None,
exclude: "IncEx | None" = None,
by_alias: bool = False,
exclude_unset: bool = False,
exclude_defaults: bool = False,
Expand Down
4 changes: 2 additions & 2 deletions ampel/base/AmpelUnit.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ def _get_trace_content(self) -> dict[str, Any]:
def dict(
self,
*,
include: "IncEx" = None,
exclude: "IncEx" = None,
include: "IncEx | None" = None,
exclude: "IncEx | None" = None,
by_alias: bool = False,
exclude_unset: bool = False,
exclude_defaults: bool = False,
Expand Down

0 comments on commit 720e9ef

Please sign in to comment.