Skip to content

Commit

Permalink
feat: add overload.
Browse files Browse the repository at this point in the history
Signed-off-by: yassun7010 <[email protected]>
  • Loading branch information
yassun7010 committed Sep 30, 2024
1 parent 0207fba commit 62073f4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pandera/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
Union,
)

from typing_extensions import overload

try:
# python 3.8+
from typing import Literal # type: ignore[attr-defined]
Expand Down Expand Up @@ -89,6 +91,18 @@ def __hash__(self) -> int:
_DataTypeClass = Type[_Dtype]


@overload
def immutable(
pandera_dtype_cls: _DataTypeClass, **dataclass_kwargs: Any
) -> _DataTypeClass:
...

Check warning on line 98 in pandera/dtypes.py

View check run for this annotation

Codecov / codecov/patch

pandera/dtypes.py#L98

Added line #L98 was not covered by tests

@overload
def immutable(
pandera_dtype_cls: None = None, **dataclass_kwargs: Any
) -> Callable[[_DataTypeClass], _DataTypeClass]:
...

Check warning on line 104 in pandera/dtypes.py

View check run for this annotation

Codecov / codecov/patch

pandera/dtypes.py#L104

Added line #L104 was not covered by tests

def immutable(
pandera_dtype_cls: Optional[_DataTypeClass] = None, **dataclass_kwargs: Any
) -> Union[_DataTypeClass, Callable[[_DataTypeClass], _DataTypeClass]]:
Expand Down

0 comments on commit 62073f4

Please sign in to comment.