Skip to content
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

dask/tests/test_distributed.py::test_map_partitions_df_input failing #10335

Closed
Tracked by #327
jrbourbeau opened this issue Jun 6, 2023 · 2 comments · Fixed by dask/distributed#7895
Closed
Tracked by #327
Labels
bug Something is broken dataframe

Comments

@jrbourbeau
Copy link
Member

dask/tests/test_distributed.py::test_map_partitions_df_input is failing on main with

RuntimeError: shuffle_unpack failed during shuffle 53a3327765b9171a0d39308129460022

See the full traceback in this CI build

cc @hendrikmakait

xref #10334

@jrbourbeau jrbourbeau added dataframe bug Something is broken labels Jun 6, 2023
@jrbourbeau
Copy link
Member Author

jrbourbeau commented Jun 6, 2023

Looks like we're not properly handling how we pass meta around

>   return df.astype(meta.dtypes)
E   AttributeError: 'Serialize' object has no attribute 'dtypes'

../distributed/distributed/shuffle/_arrow.py:59: AttributeError

EDIT: Something simple like

diff --git a/distributed/shuffle/_arrow.py b/distributed/shuffle/_arrow.py
index 6a0bc81e..84620c07 100644
--- a/distributed/shuffle/_arrow.py
+++ b/distributed/shuffle/_arrow.py
@@ -4,6 +4,7 @@ from io import BytesIO
 from typing import TYPE_CHECKING

 from packaging.version import parse
+from distributed.protocol import Serialize

 if TYPE_CHECKING:
     import pandas as pd
@@ -56,6 +57,8 @@ def convert_partition(data: bytes, meta: pd.DataFrame) -> pd.DataFrame:
         shards.append(sr.read_all())
     table = pa.concat_tables(shards)
     df = table.to_pandas(self_destruct=True)
+    if isinstance(meta, Serialize):
+        meta = meta.data
     return df.astype(meta.dtypes)

fixes the problem. But I've not thought deeply yet about why we're getting a Serialize instance here in the first place. There may be a better fix

@rjzamora
Copy link
Member

rjzamora commented Jun 8, 2023

But I've not thought deeply yet about why we're getting a Serialize instance here in the first place.

Pretty sure this all comes back to #8581 (I see use_processes=False in test_map_partitions_df_input). Though I expected the pickle changes to fix this, so this hunch could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken dataframe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants