[dask] Fix empty partition with pandas input. (#7644)
Empty partition is different from empty dataset. For the former case, each worker has non-empty dask collections, but each collection might contain empty partition.
This commit is contained in:
@@ -1062,6 +1062,9 @@ def _maybe_dataframe(
|
||||
prediction, columns=columns, dtype=numpy.float32, index=index
|
||||
)
|
||||
else:
|
||||
if prediction.size == 0:
|
||||
return DataFrame({}, columns=columns, dtype=numpy.float32, index=index)
|
||||
|
||||
prediction = DataFrame(
|
||||
prediction, columns=columns, dtype=numpy.float32, index=index
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user