Conversation
…ject')] are in the [columns]" Added test
|
@joshua-gould Thanks for your PR! I was trying to reproduce the error you're fixing and found that it relates to #335. The following code test_labels = da.zeros((10, 10), dtype='int', chunks=(3, 3))
test_labels[0, 0] = 1
computed_result = dask_image.ndmeasure.find_objects(test_labels).compute()fails in the presence of Unsure how to proceed, there might be an error to reproduce upstream in |
|
I ran into this issue with find_objects too, and setting |
|
Thanks @jmuhlich for reporting this here! It seems that the following example (which is also included in the tests added in this PR): import dask.array as da
import dask_image.ndmeasure
test_labels = da.zeros((10, 10), dtype='int', chunks=(3, 3))
test_labels[0, 0] = 1
computed_result = dask_image.ndmeasure.find_objects(test_labels).compute(scheduler='single-threaded')
In this PR, @joshua-gould works around problems that occur when merging dask dataframes. Also here theres a mention of a pandas bug when merging dataframes. The error here might be related to that. I didn't have the time yet to find out what's going wrong in the merge. I think it'd be good to report the results of this upstream. Independent of upstream we should incorporate this workaround here I think.
@jmuhlich Does the code in this PR fix the problems you mention? |
|
Fixed up some conflicts introduced by a recent PR fixing CI: #393 Hope that is ok Please feel free to tweak further as needed |
Quick summaryThis PR fixes Problem on mainThe following fails import dask.array as da
import dask_image.ndmeasure
test_labels = da.zeros((10, 10), dtype='int', chunks=(3, 3))
test_labels[0, 0] = 1
computed_result = dask_image.ndmeasure.find_objects(test_labels).compute(scheduler='single-threaded')The fix in this PRThe following fails with empty ddf = dd.merge(df1, df2, how="outer", left_index=True, right_index=True)The following workaround in this PR fixes it: if len(df1) > 0 and len(df2) > 0:
ddf = dd.merge(
df1, df2,
how="outer", left_index=True, right_index=True)
elif len(df1) > 0:
ddf = df1
elif len(df2) > 0:
ddf = df2
else:
ddf = pd.DataFrame()ConclusionI suspect there's a problem with Since the workaround here works and fixes a problem that came up for different people, I'd propose to merge this PR as is and report a potential problem upstream once we identify it. What do you think @jakirkham? 🙏 |
|
This came up in a new issue again #403 so I'll go ahead and merge this. If further discussion / changes are required I suggest we open a new issue! Thanks @joshua-gould for this fix and everyone for contributing 🙏 |
No description provided.