Skip to content

CLN remove dataframe api consortium entrypoint #57482

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
Feb 19, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/package-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
extra: ["test", "performance", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output-formatting", "clipboard", "compression", "consortium-standard", "all"]
extra: ["test", "performance", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output-formatting", "clipboard", "compression", "all"]
fail-fast: false
name: Install Extras - ${{ matrix.extra }}
concurrency:
Expand Down
1 change: 0 additions & 1 deletion ci/deps/actions-311-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,4 @@ dependencies:
- pip:
- adbc-driver-postgresql>=0.8.0
- adbc-driver-sqlite>=0.8.0
- dataframe-api-compat>=0.1.7
- tzdata>=2022.7
1 change: 0 additions & 1 deletion ci/deps/actions-39-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,4 @@ dependencies:
- pip:
- adbc-driver-postgresql==0.8.0
- adbc-driver-sqlite==0.8.0
- dataframe-api-compat==0.1.7
- tzdata==2022.7
11 changes: 0 additions & 11 deletions doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,3 @@ Dependency Minimum Version pip extra Notes
========================= ================== =============== =============================================================
Zstandard 0.19.0 compression Zstandard compression
========================= ================== =============== =============================================================

Consortium Standard
^^^^^^^^^^^^^^^^^^^

Installable with ``pip install "pandas[consortium-standard]"``

========================= ================== =================== =============================================================
Dependency Minimum Version pip extra Notes
========================= ================== =================== =============================================================
dataframe-api-compat 0.1.7 consortium-standard Consortium Standard-compatible implementation based on pandas
========================= ================== =================== =============================================================
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,5 @@ dependencies:
- pip:
- adbc-driver-postgresql>=0.8.0
- adbc-driver-sqlite>=0.8.0
- dataframe-api-compat>=0.1.7
- typing_extensions; python_version<"3.11"
- tzdata>=2022.7
1 change: 0 additions & 1 deletion pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"bs4": "4.11.2",
"blosc": "1.21.3",
"bottleneck": "1.3.6",
"dataframe-api-compat": "0.1.7",
"fastparquet": "2023.04.0",
"fsspec": "2022.11.0",
"html5lib": "1.1",
Expand Down
15 changes: 0 additions & 15 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,21 +938,6 @@ def __dataframe__(

return PandasDataFrameXchg(self, allow_copy=allow_copy)

def __dataframe_consortium_standard__(
self, *, api_version: str | None = None
) -> Any:
"""
Provide entry point to the Consortium DataFrame Standard API.

This is developed and maintained outside of pandas.
Please report any issues to https://github.com/data-apis/dataframe-api-compat.
"""
dataframe_api_compat = import_optional_dependency("dataframe_api_compat")
convert_to_standard_compliant_dataframe = (
dataframe_api_compat.pandas_standard.convert_to_standard_compliant_dataframe
)
return convert_to_standard_compliant_dataframe(self, api_version=api_version)

def __arrow_c_stream__(self, requested_schema=None):
"""
Export the pandas DataFrame as an Arrow C stream PyCapsule.
Expand Down
17 changes: 0 additions & 17 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from pandas._libs.lib import is_range_indexer
from pandas.compat import PYPY
from pandas.compat._constants import REF_COUNT
from pandas.compat._optional import import_optional_dependency
from pandas.compat.numpy import function as nv
from pandas.errors import (
ChainedAssignmentError,
Expand Down Expand Up @@ -845,22 +844,6 @@ def __array__(self, dtype: npt.DTypeLike | None = None) -> np.ndarray:

# ----------------------------------------------------------------------

def __column_consortium_standard__(self, *, api_version: str | None = None) -> Any:
"""
Provide entry point to the Consortium DataFrame Standard API.

This is developed and maintained outside of pandas.
Please report any issues to https://github.com/data-apis/dataframe-api-compat.
"""
dataframe_api_compat = import_optional_dependency("dataframe_api_compat")
return (
dataframe_api_compat.pandas_standard.convert_to_standard_compliant_column(
self, api_version=api_version
)
)

# ----------------------------------------------------------------------

# indexers
@property
def axes(self) -> list[Index]:
Expand Down
19 changes: 0 additions & 19 deletions pandas/tests/test_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,25 +306,6 @@ def test_from_obscure_array(dtype, box):
tm.assert_index_equal(result, expected)


def test_dataframe_consortium() -> None:
"""
Test some basic methods of the dataframe consortium standard.

Full testing is done at https://github.com/data-apis/dataframe-api-compat,
this is just to check that the entry point works as expected.
"""
pytest.importorskip("dataframe_api_compat")
df_pd = DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
df = df_pd.__dataframe_consortium_standard__()
result_1 = df.get_column_names()
expected_1 = ["a", "b"]
assert result_1 == expected_1

ser = Series([1, 2, 3], name="a")
col = ser.__column_consortium_standard__()
assert col.name == "a"


def test_xarray_coerce_unit():
# GH44053
xr = pytest.importorskip("xarray")
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ plot = ['matplotlib>=3.6.3']
output-formatting = ['jinja2>=3.1.2', 'tabulate>=0.9.0']
clipboard = ['PyQt5>=5.15.9', 'qtpy>=2.3.0']
compression = ['zstandard>=0.19.0']
consortium-standard = ['dataframe-api-compat>=0.1.7']
all = ['adbc-driver-postgresql>=0.8.0',
'adbc-driver-sqlite>=0.8.0',
'beautifulsoup4>=4.11.2',
# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
#'blosc>=1.21.3',
'bottleneck>=1.3.6',
'dataframe-api-compat>=0.1.7',
'fastparquet>=2023.04.0',
'fsspec>=2022.11.0',
'gcsfs>=2022.11.0',
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ requests
pygments
adbc-driver-postgresql>=0.8.0
adbc-driver-sqlite>=0.8.0
dataframe-api-compat>=0.1.7
typing_extensions; python_version<"3.11"
tzdata>=2022.7