Skip to content

Commit

Permalink
fix(pydantic): bump pydantic version for tests and fix typing issue (#…
Browse files Browse the repository at this point in the history
…437)

* Auto stash before merge of "fix_pydantic_bump" and "origin/main"

* fix pydantic field
  • Loading branch information
DeltaDaniel authored Sep 11, 2024
1 parent 1079abc commit c90893b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dev_requirements/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pandas==2.2.2
# via kohlrahbi (pyproject.toml)
pluggy==1.5.0
# via pytest
pydantic==2.8.1
pydantic==2.9.1
# via kohlrahbi (pyproject.toml)
pydantic-core==2.20.1
pydantic-core==2.23.3
# via pydantic
pytest==8.3.2
# via
Expand Down
4 changes: 2 additions & 2 deletions src/kohlrahbi/models/edifact_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
from abc import ABC
from enum import Enum
from typing import Callable, Iterable, Literal, Mapping, Optional
from typing import Callable, Iterable, Literal, Mapping, Optional, Union

from pydantic import BaseModel, Field, StringConstraints, field_validator
from typing_extensions import Annotated
Expand Down Expand Up @@ -238,7 +238,7 @@ class Segment(SegmentLevel):
A Segment contains multiple data elements.
"""

data_elements: list[DataElementValuePool | DataElementFreeText] = Field(discriminator="value_type")
data_elements: list[Annotated[Union[DataElementValuePool, DataElementFreeText], Field(discriminator="value_type")]]
section_name: Optional[str] = Field(
default=None,
description=(
Expand Down

0 comments on commit c90893b

Please sign in to comment.