55import decimal
66import inspect
77import warnings
8- from typing import (
9- Any ,
10- Literal ,
11- Optional ,
12- Union ,
13- )
8+ from typing import Any , Literal , Optional , Union , Type
149from collections .abc import Iterable , Mapping , Sequence
1510
1611import polars as pl
@@ -229,8 +224,7 @@ def dtype(cls, data_type: Any) -> dtypes.DataType:
229224 pl_dtype = convert_py_dtype_to_polars_dtype (data_type )
230225 except ValueError :
231226 raise TypeError (
232- f"data type '{ data_type } ' not understood by "
233- f"{ cls .__name__ } ."
227+ f"data type '{ data_type } ' not understood by { cls .__name__ } ."
234228 ) from None
235229
236230 try :
@@ -455,7 +449,7 @@ class Date(DataType, dtypes.Date):
455449class DateTime (DataType , dtypes .DateTime ):
456450 """Polars datetime data type."""
457451
458- type : type [pl .Datetime ] = pl .Datetime
452+ type : Type [pl .Datetime ] = pl .Datetime
459453 time_zone_agnostic : bool = False
460454
461455 def __init__ ( # pylint:disable=super-init-not-called
@@ -464,7 +458,6 @@ def __init__( # pylint:disable=super-init-not-called
464458 time_zone : Optional [str ] = None ,
465459 time_unit : Optional [str ] = None ,
466460 ) -> None :
467-
468461 _kwargs = {}
469462 if time_unit is not None :
470463 # avoid deprecated warning when initializing pl.Datetime:
@@ -566,7 +559,6 @@ def __init__( # pylint:disable=super-init-not-called
566559 * ,
567560 width : Optional [int ] = None ,
568561 ) -> None :
569-
570562 kwargs : dict [str , Union [int , tuple [int , ...]]] = {}
571563 if width is not None :
572564 kwargs ["shape" ] = width
@@ -713,8 +705,7 @@ def check(
713705 return False
714706
715707 return (
716- self .type == pandera_dtype .type
717- and (self .type .categories == pandera_dtype .categories ).all () # type: ignore
708+ self .type == pandera_dtype .type and (self .type .categories == pandera_dtype .categories ).all () # type: ignore
718709 )
719710
720711
0 commit comments