@@ -39,7 +39,12 @@ def __init__(
3939 max : dt .date | None = None ,
4040 max_exclusive : dt .date | None = None ,
4141 resolution : str | None = None ,
42- check : Callable [[pl .Expr ], pl .Expr ] | None = None ,
42+ check : (
43+ Callable [[pl .Expr ], pl .Expr ]
44+ | list [Callable [[pl .Expr ], pl .Expr ]]
45+ | dict [str , Callable [[pl .Expr ], pl .Expr ]]
46+ | None
47+ ) = None ,
4348 alias : str | None = None ,
4449 metadata : dict [str , Any ] | None = None ,
4550 ):
@@ -61,8 +66,17 @@ def __init__(
6166 formatting language used by :mod:`polars` datetime ``round`` method.
6267 For example, a value ``1mo`` expects all dates to be on the first of the
6368 month. Note that this setting does *not* affect the storage resolution.
64- check: A custom check to run for this column. Must return a non-aggregated
65- boolean expression.
69+ check: A custom rule or multiple rules to run for this column. This can be:
70+ - A single callable that returns a non-aggregated boolean expression.
71+ The name of the rule is derived from the callable name, or defaults to
72+ "check" for lambdas.
73+ - A list of callables, where each callable returns a non-aggregated
74+ boolean expression. The name of the rule is derived from the callable
75+ name, or defaults to "check" for lambdas. Where multiple rules result
76+ in the same name, the suffix __i is appended to the name.
77+ - A dictionary mapping rule names to callables, where each callable
78+ returns a non-aggregated boolean expression.
79+ All rule names provided here are given the prefix "check_".
6680 alias: An overwrite for this column's name which allows for using a column
6781 name that is not a valid Python identifier. Especially note that setting
6882 this option does _not_ allow to refer to the column with two different
@@ -152,7 +166,12 @@ def __init__(
152166 max : dt .time | None = None ,
153167 max_exclusive : dt .time | None = None ,
154168 resolution : str | None = None ,
155- check : Callable [[pl .Expr ], pl .Expr ] | None = None ,
169+ check : (
170+ Callable [[pl .Expr ], pl .Expr ]
171+ | list [Callable [[pl .Expr ], pl .Expr ]]
172+ | dict [str , Callable [[pl .Expr ], pl .Expr ]]
173+ | None
174+ ) = None ,
156175 alias : str | None = None ,
157176 metadata : dict [str , Any ] | None = None ,
158177 ):
@@ -174,8 +193,17 @@ def __init__(
174193 formatting language used by :mod:`polars` datetime ``round`` method.
175194 For example, a value ``1h`` expects all times to be full hours. Note
176195 that this setting does *not* affect the storage resolution.
177- check: A custom check to run for this column. Must return a non-aggregated
178- boolean expression.
196+ check: A custom rule or multiple rules to run for this column. This can be:
197+ - A single callable that returns a non-aggregated boolean expression.
198+ The name of the rule is derived from the callable name, or defaults to
199+ "check" for lambdas.
200+ - A list of callables, where each callable returns a non-aggregated
201+ boolean expression. The name of the rule is derived from the callable
202+ name, or defaults to "check" for lambdas. Where multiple rules result
203+ in the same name, the suffix __i is appended to the name.
204+ - A dictionary mapping rule names to callables, where each callable
205+ returns a non-aggregated boolean expression.
206+ All rule names provided here are given the prefix "check_".
179207 alias: An overwrite for this column's name which allows for using a column
180208 name that is not a valid Python identifier. Especially note that setting
181209 this option does _not_ allow to refer to the column with two different
@@ -271,7 +299,12 @@ def __init__(
271299 max : dt .datetime | None = None ,
272300 max_exclusive : dt .datetime | None = None ,
273301 resolution : str | None = None ,
274- check : Callable [[pl .Expr ], pl .Expr ] | None = None ,
302+ check : (
303+ Callable [[pl .Expr ], pl .Expr ]
304+ | list [Callable [[pl .Expr ], pl .Expr ]]
305+ | dict [str , Callable [[pl .Expr ], pl .Expr ]]
306+ | None
307+ ) = None ,
275308 alias : str | None = None ,
276309 metadata : dict [str , Any ] | None = None ,
277310 ):
@@ -293,8 +326,17 @@ def __init__(
293326 the formatting language used by :mod:`polars` datetime ``round`` method.
294327 For example, a value ``1h`` expects all datetimes to be full hours. Note
295328 that this setting does *not* affect the storage resolution.
296- check: A custom check to run for this column. Must return a non-aggregated
297- boolean expression.
329+ check: A custom rule or multiple rules to run for this column. This can be:
330+ - A single callable that returns a non-aggregated boolean expression.
331+ The name of the rule is derived from the callable name, or defaults to
332+ "check" for lambdas.
333+ - A list of callables, where each callable returns a non-aggregated
334+ boolean expression. The name of the rule is derived from the callable
335+ name, or defaults to "check" for lambdas. Where multiple rules result
336+ in the same name, the suffix __i is appended to the name.
337+ - A dictionary mapping rule names to callables, where each callable
338+ returns a non-aggregated boolean expression.
339+ All rule names provided here are given the prefix "check_".
298340 alias: An overwrite for this column's name which allows for using a column
299341 name that is not a valid Python identifier. Especially note that setting
300342 this option does _not_ allow to refer to the column with two different
@@ -380,7 +422,12 @@ def __init__(
380422 max : dt .timedelta | None = None ,
381423 max_exclusive : dt .timedelta | None = None ,
382424 resolution : str | None = None ,
383- check : Callable [[pl .Expr ], pl .Expr ] | None = None ,
425+ check : (
426+ Callable [[pl .Expr ], pl .Expr ]
427+ | list [Callable [[pl .Expr ], pl .Expr ]]
428+ | dict [str , Callable [[pl .Expr ], pl .Expr ]]
429+ | None
430+ ) = None ,
384431 alias : str | None = None ,
385432 metadata : dict [str , Any ] | None = None ,
386433 ):
@@ -402,8 +449,17 @@ def __init__(
402449 the formatting language used by :mod:`polars` datetime ``round`` method.
403450 For example, a value ``1h`` expects all durations to be full hours. Note
404451 that this setting does *not* affect the storage resolution.
405- check: A custom check to run for this column. Must return a non-aggregated
406- boolean expression.
452+ check: A custom rule or multiple rules to run for this column. This can be:
453+ - A single callable that returns a non-aggregated boolean expression.
454+ The name of the rule is derived from the callable name, or defaults to
455+ "check" for lambdas.
456+ - A list of callables, where each callable returns a non-aggregated
457+ boolean expression. The name of the rule is derived from the callable
458+ name, or defaults to "check" for lambdas. Where multiple rules result
459+ in the same name, the suffix __i is appended to the name.
460+ - A dictionary mapping rule names to callables, where each callable
461+ returns a non-aggregated boolean expression.
462+ All rule names provided here are given the prefix "check_".
407463 alias: An overwrite for this column's name which allows for using a column
408464 name that is not a valid Python identifier. Especially note that setting
409465 this option does _not_ allow to refer to the column with two different
0 commit comments