You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Writing CSV to disk hangs if the DataFrame is large-ish with a string (object) index (no errors in logs, not out of memory) #4990
What happened:
Dask hangs when writing a large DataFrame to the disk in CSV format.
What you expected to happen:
The DataFrame should have been saved to the disk.
Minimal Complete Verifiable Example:
importmultiprocessing.popen_spawn_win32fromdask.distributedimportClientimportdask.dataframeasddimportpandasaspdfromshutilimportrmtreeimportnumpyasnpclient=Client()
# create two DataFrames, one with a string index and one without itNrows=83345093df=pd.DataFrame(np.random.randn(Nrows, 2), columns=list('AB'), index=pd.util.testing.rands_array(16, Nrows, dtype='O'))
df2=pd.DataFrame(np.random.randn(Nrows, 2), columns=list('AB'))
# create two Dask DataFramesddf=dd.from_pandas(df, npartitions=240)
ddf2=dd.from_pandas(df2, npartitions=240)
# dump the DataFrame without the string index (this works)ddf2.to_csv('output')
rmtree('output')
ddf2.to_csv('output')
rmtree('output')
# dump the DataFrame with the string index, but one partition at a time (this works)forpartition_idinrange(240):
print(partition_id)
ax=ddf.get_partition(partition_id)
_=ax.to_csv('output')
rmtree('output')
# dump the DataFrame with the string index, all partitions (this hangs at some point)ddf.to_csv('output')
rmtree('output')
ddf.to_csv('output')
rmtree('output')
changed the title [-]Writing CSV to disk hangs if the DataFrame is large with a string (object) index[/-][+]Writing CSV to disk hangs if the DataFrame is large-ish with a string (object) index (no errors in logs, not out of memory)[/+]on Jun 30, 2021
Activity
[-]Writing CSV to disk hangs if the DataFrame is large with a string (object) index[/-][+]Writing CSV to disk hangs if the DataFrame is large-ish with a string (object) index (no errors in logs, not out of memory)[/+]jrbourbeau commentedon Jun 30, 2021
Closing to avoid duplicates issues (xref dask/dask#7848)