From 3cd7b192442853c3dfb048cae903cd293cd3f9e8 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Tue, 2 May 2023 11:12:20 +0100 Subject: [PATCH] make skip_nulls keyword-only where possible --- .../dataframe_api/column_object.py | 20 ++++++++-------- .../dataframe_api/dataframe_object.py | 24 +++++++++---------- .../dataframe_api/groupby_object.py | 20 ++++++++-------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/spec/API_specification/dataframe_api/column_object.py b/spec/API_specification/dataframe_api/column_object.py index c11da438..8419e1eb 100644 --- a/spec/API_specification/dataframe_api/column_object.py +++ b/spec/API_specification/dataframe_api/column_object.py @@ -270,7 +270,7 @@ def __invert__(self) -> Column: If any of the Column's columns is not boolean. """ - def any(self, skip_nulls: bool = True) -> bool: + def any(self, *, skip_nulls: bool = True) -> bool: """ Reduction returns a bool. @@ -280,7 +280,7 @@ def any(self, skip_nulls: bool = True) -> bool: If column is not boolean. """ - def all(self, skip_nulls: bool = True) -> bool: + def all(self, *, skip_nulls: bool = True) -> bool: """ Reduction returns a bool. @@ -290,32 +290,32 @@ def all(self, skip_nulls: bool = True) -> bool: If column is not boolean. """ - def min(self, skip_nulls: bool = True) -> dtype: + def min(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Any data type that supports comparisons must be supported. The returned value has the same dtype as the column. """ - def max(self, skip_nulls: bool = True) -> dtype: + def max(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Any data type that supports comparisons must be supported. The returned value has the same dtype as the column. """ - def sum(self, skip_nulls: bool = True) -> dtype: + def sum(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Must be supported for numerical and datetime data types. The returned value has the same dtype as the column. """ - def prod(self, skip_nulls: bool = True) -> dtype: + def prod(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Must be supported for numerical data types. The returned value has the same dtype as the column. """ - def median(self, skip_nulls: bool = True) -> dtype: + def median(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Must be supported for numerical and datetime data types. Returns a float for numerical data types, and @@ -323,7 +323,7 @@ def median(self, skip_nulls: bool = True) -> dtype: dtypes. """ - def mean(self, skip_nulls: bool = True) -> dtype: + def mean(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Must be supported for numerical and datetime data types. Returns a float for numerical data types, and @@ -331,7 +331,7 @@ def mean(self, skip_nulls: bool = True) -> dtype: dtypes. """ - def std(self, skip_nulls: bool = True) -> dtype: + def std(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Must be supported for numerical and datetime data types. Returns a float for numerical data types, and @@ -339,7 +339,7 @@ def std(self, skip_nulls: bool = True) -> dtype: dtypes. """ - def var(self, skip_nulls: bool = True) -> dtype: + def var(self, *, skip_nulls: bool = True) -> dtype: """ Reduction returns a scalar. Must be supported for numerical and datetime data types. Returns a float for numerical data types, and diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 29dcf5fa..a24d6b49 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -543,7 +543,7 @@ def __iter__(self) -> NoReturn: """ raise NotImplementedError("'__iter__' is intentionally not implemented.") - def any(self, skip_nulls: bool = True) -> DataFrame: + def any(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. @@ -554,7 +554,7 @@ def any(self, skip_nulls: bool = True) -> DataFrame: """ ... - def all(self, skip_nulls: bool = True) -> DataFrame: + def all(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. @@ -565,7 +565,7 @@ def all(self, skip_nulls: bool = True) -> DataFrame: """ ... - def any_rowwise(self, skip_nulls: bool = True) -> Column: + def any_rowwise(self, *, skip_nulls: bool = True) -> Column: """ Reduction returns a Column. @@ -579,7 +579,7 @@ def any_rowwise(self, skip_nulls: bool = True) -> Column: """ ... - def all_rowwise(self, skip_nulls: bool = True) -> Column: + def all_rowwise(self, *, skip_nulls: bool = True) -> Column: """ Reduction returns a Column. @@ -593,49 +593,49 @@ def all_rowwise(self, skip_nulls: bool = True) -> Column: """ ... - def min(self, skip_nulls: bool = True) -> DataFrame: + def min(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def max(self, skip_nulls: bool = True) -> DataFrame: + def max(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def sum(self, skip_nulls: bool = True) -> DataFrame: + def sum(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def prod(self, skip_nulls: bool = True) -> DataFrame: + def prod(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def median(self, skip_nulls: bool = True) -> DataFrame: + def median(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def mean(self, skip_nulls: bool = True) -> DataFrame: + def mean(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def std(self, skip_nulls: bool = True) -> DataFrame: + def std(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ ... - def var(self, skip_nulls: bool = True) -> DataFrame: + def var(self, *, skip_nulls: bool = True) -> DataFrame: """ Reduction returns a 1-row DataFrame. """ diff --git a/spec/API_specification/dataframe_api/groupby_object.py b/spec/API_specification/dataframe_api/groupby_object.py index ee74ed95..cfc7bc62 100644 --- a/spec/API_specification/dataframe_api/groupby_object.py +++ b/spec/API_specification/dataframe_api/groupby_object.py @@ -17,34 +17,34 @@ class GroupBy: **Methods** """ - def any(self, skip_nulls: bool = True) -> "DataFrame": + def any(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def all(self, skip_nulls: bool = True) -> "DataFrame": + def all(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def min(self, skip_nulls: bool = True) -> "DataFrame": + def min(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def max(self, skip_nulls: bool = True) -> "DataFrame": + def max(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def sum(self, skip_nulls: bool = True) -> "DataFrame": + def sum(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def prod(self, skip_nulls: bool = True) -> "DataFrame": + def prod(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def median(self, skip_nulls: bool = True) -> "DataFrame": + def median(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def mean(self, skip_nulls: bool = True) -> "DataFrame": + def mean(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def std(self, skip_nulls: bool = True) -> "DataFrame": + def std(self, *, skip_nulls: bool = True) -> "DataFrame": ... - def var(self, skip_nulls: bool = True) -> "DataFrame": + def var(self, *, skip_nulls: bool = True) -> "DataFrame": ... def size(self) -> "DataFrame":