Skip to content

Commit

Permalink
Fix stp for new typeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
caneff committed Oct 10, 2023
1 parent 909e52a commit 7a3d106
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy<=1.26.0
pandas<=2.1.1
pandas-stubs<=2.1.1.230928
typeguard<=2.13.3
typeguard>=4.0
8 changes: 4 additions & 4 deletions strictly_typed_pandas/typeguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from strictly_typed_pandas import DataSet, IndexedDataSet


def check_dataset(argname: str, value, expected_type, memo: typeguard._TypeCheckMemo) -> None:
def check_dataset(argname: str, value, expected_type, memo: typeguard.TypeCheckMemo) -> None:
schema_expected = expected_type.__args__[0]
if not isinstance(value, DataSet):
msg = "Type of {argname} must be a DataSet[{schema_expected}]; got {class_observed} instead"
Expand All @@ -27,7 +27,7 @@ def check_dataset(argname: str, value, expected_type, memo: typeguard._TypeCheck
)


def check_indexed_dataset(argname: str, value, expected_type, memo: typeguard._TypeCheckMemo):
def check_indexed_dataset(argname: str, value, expected_type, memo: typeguard.TypeCheckMemo):
schema_index_expected = expected_type.__args__[0]
schema_data_expected = expected_type.__args__[1]
if not isinstance(value, IndexedDataSet):
Expand Down Expand Up @@ -62,6 +62,6 @@ def check_indexed_dataset(argname: str, value, expected_type, memo: typeguard._T
)


typeguard.origin_type_checkers[DataSet] = check_dataset
typeguard.origin_type_checkers[IndexedDataSet] = check_indexed_dataset
typeguard._checkers.origin_type_checkers[DataSet] = check_dataset
typeguard._checkers.origin_type_checkers[IndexedDataSet] = check_indexed_dataset
typechecked = typeguard.typechecked

0 comments on commit 7a3d106

Please sign in to comment.