Skip to content

Commit 112bf74

Browse files
committed
DOC: Clarify DataFrameXchg parameter is deprecated in from_dataframe
The from_dataframe function documentation referenced DataFrameXchg type hint which is deprecated. Updated docstrings to use DataFrame and added deprecation notices to clarify that DataFrameXchg type hint is deprecated since pandas 3.0. Fixes #63111
1 parent fa5b90a commit 112bf74

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pandas/core/interchange/from_dataframe.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ def from_dataframe(df, allow_copy: bool = True) -> pd.DataFrame:
6363
6464
Parameters
6565
----------
66-
df : DataFrameXchg
66+
df : DataFrame
6767
Object supporting the interchange protocol, i.e. `__dataframe__` method.
68+
69+
.. deprecated:: 3.0
70+
The ``DataFrameXchg`` type hint is deprecated.
71+
Use ``DataFrame`` from the interchange protocol instead.
72+
6873
allow_copy : bool, default: True
6974
Whether to allow copying the memory to perform the conversion
7075
(if false then zero-copy approach is requested).
@@ -142,8 +147,12 @@ def _from_dataframe(df: DataFrameXchg, allow_copy: bool = True) -> pd.DataFrame:
142147
143148
Parameters
144149
----------
145-
df : DataFrameXchg
150+
df : DataFrame
146151
Object supporting the interchange protocol, i.e. `__dataframe__` method.
152+
153+
.. deprecated:: 3.0
154+
The ``DataFrameXchg`` type hint is deprecated.
155+
147156
allow_copy : bool, default: True
148157
Whether to allow copying the memory to perform the conversion
149158
(if false then zero-copy approach is requested).

0 commit comments

Comments
 (0)