Skip to content

Commit

Permalink
Merge pull request #23 from NowanIlfideme/fix/mypy-utils
Browse files Browse the repository at this point in the history
Fixes for mypy in utils
  • Loading branch information
NowanIlfideme committed May 10, 2023
2 parents e6a1173 + 2300b16 commit f35316d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pydantic_kedro/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Literal, Type, TypeVar

from kedro.io.core import AbstractDataSet
from pydantic import BaseModel

from pydantic_kedro.datasets.auto import PydanticAutoDataSet
Expand All @@ -15,7 +16,7 @@
T = TypeVar("T", bound=BaseModel)


def load_model(uri: str, supercls: Type[T] = BaseModel) -> T:
def load_model(uri: str, supercls: Type[T] = BaseModel) -> T: # type: ignore
"""Load a Pydantic model from a given URI.
Parameters
Expand Down Expand Up @@ -52,6 +53,7 @@ def save_model(
"""
if not isinstance(model, BaseModel):
raise TypeError(f"Expected Pydantic model, but got {model!r}")
ds: AbstractDataSet
if format == "auto":
ds = PydanticAutoDataSet(uri)
elif format == "zip":
Expand Down

0 comments on commit f35316d

Please sign in to comment.