1111class ValidationError (Exception ):
1212 """Error raised when :mod:`dataframely` validation encounters an issue."""
1313
14- def __init__ (self , message : str ):
14+ def __init__ (self , message : str ) -> None :
1515 super ().__init__ ()
1616 self .message = message
1717
@@ -22,7 +22,9 @@ def __str__(self) -> str:
2222class DtypeValidationError (ValidationError ):
2323 """Validation error raised when column dtypes are wrong."""
2424
25- def __init__ (self , errors : dict [str , tuple [PolarsDataType , PolarsDataType ]]):
25+ def __init__ (
26+ self , errors : dict [str , tuple [PolarsDataType , PolarsDataType ]]
27+ ) -> None :
2628 super ().__init__ (f"{ len (errors )} columns have an invalid dtype" )
2729 self .errors = errors
2830
@@ -37,7 +39,7 @@ def __str__(self) -> str:
3739class RuleValidationError (ValidationError ):
3840 """Complex validation error raised when rule validation fails."""
3941
40- def __init__ (self , errors : dict [str , int ]):
42+ def __init__ (self , errors : dict [str , int ]) -> None :
4143 super ().__init__ (f"{ len (errors )} rules failed validation" )
4244
4345 # Split into schema errors and column errors
@@ -75,11 +77,11 @@ def __str__(self) -> str:
7577class MemberValidationError (ValidationError ):
7678 """Validation error raised when multiple members of a collection fail validation."""
7779
78- def __init__ (self , errors : dict [str , ValidationError ]):
80+ def __init__ (self , errors : dict [str , ValidationError ]) -> None :
7981 super ().__init__ (f"{ len (errors )} members failed validation" )
8082 self .errors = errors
8183
82- def __str__ (self ):
84+ def __str__ (self ) -> str :
8385 details = [
8486 f" > Member '{ name } ' failed validation:\n "
8587 + "\n " .join (" " + line for line in str (error ).split ("\n " ))
@@ -95,7 +97,7 @@ class ImplementationError(Exception):
9597class AnnotationImplementationError (ImplementationError ):
9698 """Error raised when the annotations of a collection are invalid."""
9799
98- def __init__ (self , attr : str , kls : type ):
100+ def __init__ (self , attr : str , kls : type ) -> None :
99101 message = (
100102 "Annotations of a 'dy.Collection' may only be an (optional) "
101103 f"'dy.LazyFrame', but \" { attr } \" has type '{ kls } '."
@@ -106,7 +108,9 @@ def __init__(self, attr: str, kls: type):
106108class RuleImplementationError (ImplementationError ):
107109 """Error raised when a rule is implemented incorrectly."""
108110
109- def __init__ (self , name : str , return_dtype : pl .DataType , is_group_rule : bool ):
111+ def __init__ (
112+ self , name : str , return_dtype : pl .DataType , is_group_rule : bool
113+ ) -> None :
110114 if is_group_rule :
111115 details = (
112116 " When implementing a group rule (i.e. when using the `group_by` "
0 commit comments