Skip to content

Commit

Permalink
MAINT: Move CoreSchema import to TYPE_CHECKING block
Browse files Browse the repository at this point in the history
  • Loading branch information
slangeveld committed Jul 5, 2024
1 parent fa31291 commit 7bbfb24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/fmu/dataio/datastructure/meta/content.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import warnings
from typing import Any, Dict, List, Literal, Optional, Union
from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Union

from pydantic import (
AwareDatetime,
Expand All @@ -13,11 +13,13 @@
field_validator,
model_validator,
)
from pydantic_core import CoreSchema
from typing_extensions import Annotated

from . import enums, specification

if TYPE_CHECKING:
from pydantic_core import CoreSchema


class Timestamp(BaseModel):
"""A timestamp object contains a datetime representation of the time
Expand Down
6 changes: 4 additions & 2 deletions src/fmu/dataio/datastructure/meta/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections import ChainMap
from pathlib import Path
from typing import Dict, List, Literal, Optional, TypeVar, Union
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, TypeVar, Union
from uuid import UUID

from pydantic import (
Expand All @@ -14,11 +14,13 @@
RootModel,
model_validator,
)
from pydantic_core import CoreSchema
from typing_extensions import Annotated

from . import content, enums

if TYPE_CHECKING:
from pydantic_core import CoreSchema

T = TypeVar("T", Dict, List, object)


Expand Down

0 comments on commit 7bbfb24

Please sign in to comment.