-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
dataframegood first issueClearly described and easy to accomplish. Good for beginners to the project.Clearly described and easy to accomplish. Good for beginners to the project.
Description
dask.data
In [12]: import dask.dataframe as dd, pandas as pd
In [13]: df = dd.from_pandas(pd.DataFrame({"A": [1, 2]}), npartitions=1)
In [14]: df.head()
/home/taugspurger/miniconda3/envs/stac-table/lib/python3.9/site-packages/dask/dataframe/core.py:6778: UserWarning: Insufficient elements for `head`. 5 elements requested, only 2 elements available. Try passing larger `npartitions` to `head`.
warnings.warn(msg.format(n, len(r)))
Out[14]:
A
0 1
1 2When there's just a single partition (or, more generally, if all the partitions are used), then there's no reason to warn.
I think the fix is change
Lines 1081 to 1084 in 7cfee4a
| if safe: | |
| head = safe_head | |
| else: | |
| head = M.head |
Line 1071 in 7cfee4a
| return self._head(n=n, npartitions=npartitions, compute=compute, safe=True) |
safe=False when npartitions == self.npartitions (or when npartitions=-1).Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dataframegood first issueClearly described and easy to accomplish. Good for beginners to the project.Clearly described and easy to accomplish. Good for beginners to the project.