@@ -53,14 +53,11 @@ def __init__(
5353 """
5454 Initialize the column quantile between expectation.
5555
56- Args:
57- column_name (str): Name of the column to check.
58- quantile (float): Quantile to compute (0.0 to 1.0, where 0.0=min, 0.5=median, 1.0=max).
59- min_value (Union[int, float]): Minimum allowed value for the column quantile (inclusive).
60- max_value (Union[int, float]): Maximum allowed value for the column quantile (inclusive).
61-
62- Raises:
63- ValueError: If quantile is not between 0.0 and 1.0.
56+ :param column_name: Name of the column to check.
57+ :param quantile: Quantile to compute (0.0 to 1.0, where 0.0=min, 0.5=median, 1.0=max).
58+ :param min_value: Minimum allowed value for the column quantile (inclusive).
59+ :param max_value: Maximum allowed value for the column quantile (inclusive).
60+ :raises ValueError: If quantile is not between 0.0 and 1.0.
6461 """
6562 if not (0.0 <= quantile <= 1.0 ):
6663 raise ValueError (f"Quantile must be between 0.0 and 1.0, got { quantile } " )
@@ -226,10 +223,9 @@ def __init__(
226223 """
227224 Initialize the column mean between expectation.
228225
229- Args:
230- column_name (str): Name of the column to check.
231- min_value (Union[int, float]): Minimum allowed value for the column mean (inclusive).
232- max_value (Union[int, float]): Maximum allowed value for the column mean (inclusive).
226+ :param column_name: Name of the column to check.
227+ :param min_value: Minimum allowed value for the column mean (inclusive).
228+ :param max_value: Maximum allowed value for the column mean (inclusive).
233229 """
234230 description = f"column '{ column_name } ' mean value between { min_value } and { max_value } "
235231
@@ -345,25 +341,25 @@ def aggregate_and_validate_pyspark(
345341 },
346342)
347343def create_expectation_column_quantile_between (
348- ** kwargs ,
344+ column_name : str ,
345+ quantile : float ,
346+ min_value : Union [int , float ],
347+ max_value : Union [int , float ],
349348) -> ExpectationColumnQuantileBetween :
350349 """
351350 Create an ExpectationColumnQuantileBetween instance.
352351
353- Args:
354- column_name (str): Name of the column to check.
355- quantile (float): Quantile to compute (0.0 to 1.0).
356- min_value (Union[int, float]): Minimum allowed value for the column quantile.
357- max_value (Union[int, float]): Maximum allowed value for the column quantile.
358-
359- Returns:
360- ExpectationColumnQuantileBetween: A configured expectation instance.
352+ :param column_name: Name of the column to check.
353+ :param quantile: Quantile to compute (0.0 to 1.0).
354+ :param min_value: Minimum allowed value for the column quantile.
355+ :param max_value: Maximum allowed value for the column quantile.
356+ :return: A configured expectation instance.
361357 """
362358 return ExpectationColumnQuantileBetween (
363- column_name = kwargs [ " column_name" ] ,
364- quantile = kwargs [ " quantile" ] ,
365- min_value = kwargs [ " min_value" ] ,
366- max_value = kwargs [ " max_value" ] ,
359+ column_name = column_name ,
360+ quantile = quantile ,
361+ min_value = min_value ,
362+ max_value = max_value ,
367363 )
368364
369365
@@ -386,24 +382,23 @@ def create_expectation_column_quantile_between(
386382 types = {"column_name" : str , "min_value" : (int , float ), "max_value" : (int , float )},
387383)
388384def create_expectation_column_max_to_be_between (
389- ** kwargs ,
385+ column_name : str ,
386+ min_value : Union [int , float ],
387+ max_value : Union [int , float ],
390388) -> ExpectationColumnQuantileBetween :
391389 """
392390 Create an ExpectationColumnQuantileBetween instance for maximum values (quantile=1.0).
393391
394- Args:
395- column_name (str): Name of the column to check.
396- min_value (Union[int, float]): Minimum allowed value for the column maximum.
397- max_value (Union[int, float]): Maximum allowed value for the column maximum.
398-
399- Returns:
400- ExpectationColumnQuantileBetween: A configured expectation instance for maximum values.
392+ :param column_name: Name of the column to check.
393+ :param min_value: Minimum allowed value for the column maximum.
394+ :param max_value: Maximum allowed value for the column maximum.
395+ :return: A configured expectation instance for maximum values.
401396 """
402397 return ExpectationColumnQuantileBetween (
403- column_name = kwargs [ " column_name" ] ,
398+ column_name = column_name ,
404399 quantile = 1.0 ,
405- min_value = kwargs [ " min_value" ] ,
406- max_value = kwargs [ " max_value" ] ,
400+ min_value = min_value ,
401+ max_value = max_value ,
407402 )
408403
409404
@@ -425,24 +420,23 @@ def create_expectation_column_max_to_be_between(
425420 types = {"column_name" : str , "min_value" : (int , float ), "max_value" : (int , float )},
426421)
427422def create_expectation_column_min_to_be_between (
428- ** kwargs ,
423+ column_name : str ,
424+ min_value : Union [int , float ],
425+ max_value : Union [int , float ],
429426) -> ExpectationColumnQuantileBetween :
430427 """
431428 Create an ExpectationColumnQuantileBetween instance for minimum values (quantile=0.0).
432429
433- Args:
434- column_name (str): Name of the column to check.
435- min_value (Union[int, float]): Minimum allowed value for the column minimum.
436- max_value (Union[int, float]): Maximum allowed value for the column minimum.
437-
438- Returns:
439- ExpectationColumnQuantileBetween: A configured expectation instance for minimum values.
430+ :param column_name: Name of the column to check.
431+ :param min_value: Minimum allowed value for the column minimum.
432+ :param max_value: Maximum allowed value for the column minimum.
433+ :return: A configured expectation instance for minimum values.
440434 """
441435 return ExpectationColumnQuantileBetween (
442- column_name = kwargs [ " column_name" ] ,
436+ column_name = column_name ,
443437 quantile = 0.0 ,
444- min_value = kwargs [ " min_value" ] ,
445- max_value = kwargs [ " max_value" ] ,
438+ min_value = min_value ,
439+ max_value = max_value ,
446440 )
447441
448442
@@ -464,25 +458,24 @@ def create_expectation_column_min_to_be_between(
464458 types = {"column_name" : str , "min_value" : (int , float ), "max_value" : (int , float )},
465459)
466460def create_expectation_column_mean_to_be_between (
467- ** kwargs ,
461+ column_name : str ,
462+ min_value : Union [int , float ],
463+ max_value : Union [int , float ],
468464) -> ExpectationColumnMeanBetween :
469465 """
470466 Create a custom ExpectationColumnMeanBetween instance for mean values.
471467 Note: This uses a separate implementation since mean is not a quantile.
472468
473- Args:
474- column_name (str): Name of the column to check.
475- min_value (Union[int, float]): Minimum allowed value for the column mean.
476- max_value (Union[int, float]): Maximum allowed value for the column mean.
477-
478- Returns:
479- ExpectationColumnMeanBetween: A configured expectation instance for mean values.
469+ :param column_name: Name of the column to check.
470+ :param min_value: Minimum allowed value for the column mean.
471+ :param max_value: Maximum allowed value for the column mean.
472+ :return: A configured expectation instance for mean values.
480473 """
481474 # For mean, we need a separate class since it's not a quantile
482475 return ExpectationColumnMeanBetween (
483- column_name = kwargs [ " column_name" ] ,
484- min_value = kwargs [ " min_value" ] ,
485- max_value = kwargs [ " max_value" ] ,
476+ column_name = column_name ,
477+ min_value = min_value ,
478+ max_value = max_value ,
486479 )
487480
488481
@@ -504,22 +497,21 @@ def create_expectation_column_mean_to_be_between(
504497 types = {"column_name" : str , "min_value" : (int , float ), "max_value" : (int , float )},
505498)
506499def create_expectation_column_median_to_be_between (
507- ** kwargs ,
500+ column_name : str ,
501+ min_value : Union [int , float ],
502+ max_value : Union [int , float ],
508503) -> ExpectationColumnQuantileBetween :
509504 """
510505 Create an ExpectationColumnQuantileBetween instance for median values (quantile=0.5).
511506
512- Args:
513- column_name (str): Name of the column to check.
514- min_value (Union[int, float]): Minimum allowed value for the column median.
515- max_value (Union[int, float]): Maximum allowed value for the column median.
516-
517- Returns:
518- ExpectationColumnQuantileBetween: A configured expectation instance for median values.
507+ :param column_name: Name of the column to check.
508+ :param min_value: Minimum allowed value for the column median.
509+ :param max_value: Maximum allowed value for the column median.
510+ :return: A configured expectation instance for median values.
519511 """
520512 return ExpectationColumnQuantileBetween (
521- column_name = kwargs [ " column_name" ] ,
513+ column_name = column_name ,
522514 quantile = 0.5 ,
523- min_value = kwargs [ " min_value" ] ,
524- max_value = kwargs [ " max_value" ] ,
515+ min_value = min_value ,
516+ max_value = max_value ,
525517 )
0 commit comments