Skip to content

Note that comparisons between columns from different dataframes is outside the standard #298

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

Closed
Closed
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
96 changes: 96 additions & 0 deletions spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ def __eq__(self, other: Self | Scalar) -> Self: # type: ignore[override]
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -219,6 +225,12 @@ def __ne__(self, other: Self | Scalar) -> Self: # type: ignore[override]
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -235,6 +247,12 @@ def __ge__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -251,6 +269,12 @@ def __gt__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -267,6 +291,12 @@ def __le__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -283,6 +313,12 @@ def __lt__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -304,6 +340,12 @@ def __and__(self, other: Self | bool) -> Self:
------
ValueError
If `self` or `other` is not boolean.

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -325,6 +367,12 @@ def __or__(self, other: Self | bool) -> Self:
------
ValueError
If `self` or `other` is not boolean.

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -341,6 +389,12 @@ def __add__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -357,6 +411,12 @@ def __sub__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -373,6 +433,12 @@ def __mul__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -389,6 +455,12 @@ def __truediv__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -405,6 +477,12 @@ def __floordiv__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -425,6 +503,12 @@ def __pow__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -441,6 +525,12 @@ def __mod__(self, other: Self | Scalar) -> Self:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand All @@ -457,6 +547,12 @@ def __divmod__(self, other: Self | Scalar) -> tuple[Column, Column]:
Returns
-------
Column

Notes
-----
If `other` is a `Column`, then the Standard only supports the case when `other`
and `self` originated from the same dataframe. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand Down
17 changes: 15 additions & 2 deletions spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ def get_rows(self, indices: Column) -> Self:
Returns
-------
DataFrame

Notes
-----
The Standard only supports the case when `indices`
originated from `self`. If it didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand Down Expand Up @@ -172,8 +178,9 @@ def filter(self, mask: Column) -> Self:

Notes
-----
Some participants preferred a weaker type Arraylike[bool] for mask,
where 'Arraylike' denotes an object adhering to the Array API standard.
The Standard only supports the case when `mask`
originated from `self`. If it didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand Down Expand Up @@ -201,6 +208,12 @@ def assign(self, *columns: Column) -> Self:
Returns
-------
DataFrame

Notes
-----
The Standard only supports the case when `columns`
originated from `self`. If they didn't, then behaviour
is unspecified and may vary across implementations.
"""
...

Expand Down