From 112bf74ddc30ac3534d4e4f50001c169800b00ba Mon Sep 17 00:00:00 2001 From: BANADDA Date: Sat, 15 Nov 2025 02:03:29 +0000 Subject: [PATCH] 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 --- pandas/core/interchange/from_dataframe.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pandas/core/interchange/from_dataframe.py b/pandas/core/interchange/from_dataframe.py index 04278c0e7856d..75111e158b651 100644 --- a/pandas/core/interchange/from_dataframe.py +++ b/pandas/core/interchange/from_dataframe.py @@ -63,8 +63,13 @@ def from_dataframe(df, allow_copy: bool = True) -> pd.DataFrame: Parameters ---------- - df : DataFrameXchg + df : DataFrame Object supporting the interchange protocol, i.e. `__dataframe__` method. + + .. deprecated:: 3.0 + The ``DataFrameXchg`` type hint is deprecated. + Use ``DataFrame`` from the interchange protocol instead. + allow_copy : bool, default: True Whether to allow copying the memory to perform the conversion (if false then zero-copy approach is requested). @@ -142,8 +147,12 @@ def _from_dataframe(df: DataFrameXchg, allow_copy: bool = True) -> pd.DataFrame: Parameters ---------- - df : DataFrameXchg + df : DataFrame Object supporting the interchange protocol, i.e. `__dataframe__` method. + + .. deprecated:: 3.0 + The ``DataFrameXchg`` type hint is deprecated. + allow_copy : bool, default: True Whether to allow copying the memory to perform the conversion (if false then zero-copy approach is requested).