Skip to content

minor unimportant formatting so pyright stops nagging me #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def __column_namespace__(self) -> Namespace:
attribute. It may contain other public names as well, but it is
recommended to only include those names that are part of the
specification.

"""
...

@property
def column(self) -> Any:
Expand All @@ -52,6 +52,7 @@ def __len__(self) -> int:
"""
Return the number of rows.
"""
...

def __iter__(self) -> NoReturn:
"""
Expand All @@ -66,10 +67,11 @@ def __iter__(self) -> NoReturn:
raise NotImplementedError("'__iter__' is intentionally not implemented.")

@property
def dtype(self) -> Any:
def dtype(self) -> DType:
"""
Return data type of column.
"""
...

def get_rows(self, indices: Self) -> Self:
"""
Expand Down Expand Up @@ -213,6 +215,7 @@ def __eq__(self, other: Self | Scalar) -> Self: # type: ignore[override]
-------
Column
"""
...

def __ne__(self, other: Self | Scalar) -> Self: # type: ignore[override]
"""
Expand All @@ -231,6 +234,7 @@ def __ne__(self, other: Self | Scalar) -> Self: # type: ignore[override]
-------
Column
"""
...

def __ge__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -247,6 +251,7 @@ def __ge__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __gt__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -263,6 +268,7 @@ def __gt__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __le__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -279,6 +285,7 @@ def __le__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __lt__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -295,6 +302,7 @@ def __lt__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __and__(self, other: Self | bool) -> Self:
"""
Expand All @@ -316,6 +324,7 @@ def __and__(self, other: Self | bool) -> Self:
ValueError
If `self` or `other` is not boolean.
"""
...

def __or__(self, other: Self | bool) -> Self:
"""
Expand All @@ -337,6 +346,7 @@ def __or__(self, other: Self | bool) -> Self:
ValueError
If `self` or `other` is not boolean.
"""
...

def __add__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -353,6 +363,7 @@ def __add__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __sub__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -369,6 +380,7 @@ def __sub__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __mul__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -385,6 +397,7 @@ def __mul__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __truediv__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -401,6 +414,7 @@ def __truediv__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __floordiv__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -417,6 +431,7 @@ def __floordiv__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __pow__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -437,6 +452,7 @@ def __pow__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __mod__(self, other: Self | Scalar) -> Self:
"""
Expand All @@ -453,6 +469,7 @@ def __mod__(self, other: Self | Scalar) -> Self:
-------
Column
"""
...

def __divmod__(self, other: Self | Scalar) -> tuple[Column, Column]:
"""
Expand All @@ -469,6 +486,7 @@ def __divmod__(self, other: Self | Scalar) -> tuple[Column, Column]:
-------
Column
"""
...

def __radd__(self, other: Self | Scalar) -> Self:
...
Expand Down Expand Up @@ -498,6 +516,7 @@ def __invert__(self) -> Self:
ValueError
If any of the Column's columns is not boolean.
"""
...

def any(self, *, skip_nulls: bool = True) -> bool | NullType:
"""
Expand All @@ -508,6 +527,7 @@ def any(self, *, skip_nulls: bool = True) -> bool | NullType:
ValueError
If column is not boolean.
"""
...

def all(self, *, skip_nulls: bool = True) -> bool | NullType:
"""
Expand All @@ -518,31 +538,36 @@ def all(self, *, skip_nulls: bool = True) -> bool | NullType:
ValueError
If column is not boolean.
"""
...

def min(self, *, skip_nulls: bool = True) -> Scalar | NullType:
"""
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) -> Scalar | NullType:
"""
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) -> Scalar | NullType:
"""
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) -> Scalar | NullType:
"""
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) -> Scalar | NullType:
"""
Expand All @@ -551,6 +576,7 @@ def median(self, *, skip_nulls: bool = True) -> Scalar | NullType:
datetime (with the appropriate timedelta format string) for datetime
dtypes.
"""
...

def mean(self, *, skip_nulls: bool = True) -> Scalar | NullType:
"""
Expand All @@ -559,6 +585,7 @@ def mean(self, *, skip_nulls: bool = True) -> Scalar | NullType:
datetime (with the appropriate timedelta format string) for datetime
dtypes.
"""
...

def std(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar | NullType:
"""
Expand All @@ -585,6 +612,7 @@ def std(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar
skip_nulls
Whether to skip null values.
"""
...

def var(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar | NullType:
"""
Expand All @@ -602,32 +630,37 @@ def var(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar
skip_nulls
Whether to skip null values.
"""
...

def cumulative_max(self) -> Self:
"""
Reduction returns a Column. Any data type that supports comparisons
must be supported. The returned value has the same dtype as the column.
"""
...

def cumulative_min(self) -> Self:
"""
Reduction returns a Column. Any data type that supports comparisons
must be supported. The returned value has the same dtype as the column.
"""
...

def cumulative_sum(self) -> Self:
"""
Reduction returns a Column. Must be supported for numerical and
datetime data types. The returned value has the same dtype as the
column.
"""
...

def cumulative_prod(self) -> Self:
"""
Reduction returns a Column. Must be supported for numerical and
datetime data types. The returned value has the same dtype as the
column.
"""
...

def is_null(self) -> Self:
"""
Expand All @@ -647,6 +680,7 @@ def is_null(self) -> Self:
May optionally include 'NaT' values (if present in an implementation),
but note that the Standard makes no guarantees about them.
"""
...

def is_nan(self) -> Self:
"""
Expand All @@ -666,6 +700,7 @@ def is_nan(self) -> Self:
Does *not* include 'missing' or 'null' entries.
In particular, does not check for `np.timedelta64('NaT')`.
"""
...

def is_in(self, values: Self) -> Self:
"""
Expand All @@ -684,6 +719,7 @@ def is_in(self, values: Self) -> Self:
-------
Column
"""
...

def unique_indices(self, *, skip_nulls: bool = True) -> Self:
"""
Expand Down Expand Up @@ -766,6 +802,7 @@ def to_array(self) -> Any:
understanding that consuming libraries would then use the
``array-api-compat`` package to convert it to a Standard-compliant array.
"""
...

def rename(self, name: str) -> Self:
"""
Expand Down
8 changes: 7 additions & 1 deletion spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __dataframe_namespace__(self) -> Namespace:
recommended to only include those names that are part of the
specification.
"""
...

@property
def dataframe(self) -> SupportsDataFrameAPI:
Expand All @@ -64,6 +65,7 @@ def shape(self) -> tuple[int, int]:
"""
Return number of rows and number of columns.
"""
...

def group_by(self, *keys: str) -> GroupBy:
"""
Expand Down Expand Up @@ -255,7 +257,7 @@ def column_names(self) -> list[str]:
...

@property
def schema(self) -> dict[str, Any]:
def schema(self) -> dict[str, DType]:
"""
Get dataframe's schema.

Expand All @@ -264,6 +266,7 @@ def schema(self) -> dict[str, Any]:
dict[str, Any]
Mapping from column name to data type.
"""
...

def sort(
self,
Expand Down Expand Up @@ -463,6 +466,7 @@ def __and__(self, other: bool) -> Self:
ValueError
If `self` or `other` is not boolean.
"""
...

def __or__(self, other: bool) -> Self:
"""
Expand All @@ -483,6 +487,7 @@ def __or__(self, other: bool) -> Self:
ValueError
If `self` or `other` is not boolean.
"""
...

def __add__(self, other: Scalar) -> Self:
"""
Expand Down Expand Up @@ -966,3 +971,4 @@ def join(
If, apart from `left_on` and `right_on`, there are any column names
present in both `self` and `other`.
"""
...