From 30d5df79eace384eb404f7a281d350b5befcf561 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:03:37 -0500 Subject: [PATCH] Fixup deprecation warning from pandas (#8564) --- distributed/shuffle/_arrow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/distributed/shuffle/_arrow.py b/distributed/shuffle/_arrow.py index 83c4afc368..71317021ac 100644 --- a/distributed/shuffle/_arrow.py +++ b/distributed/shuffle/_arrow.py @@ -93,7 +93,11 @@ def convert_shards( ): continue reconciled_dtypes[column] = find_common_type([actual, dtype]) - return df.astype(reconciled_dtypes, copy=False) + + from dask.dataframe._compat import PANDAS_GE_300 + + kwargs = {} if PANDAS_GE_300 else {"copy": False} + return df.astype(reconciled_dtypes, **kwargs) def buffers_to_table(data: list[tuple[int, bytes]]) -> pa.Table: