dask / dask/dask

Make `DataFrame.head()` and `DataFrame.tail()` lazy

Open
#10,010 2 comments 0 reactions 0 assignees View on GitHub
dataframe deprecation enhancement needs attention
Dominant language
Python
Stars
13.9k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

Currently `head()` and `tail()` trigger an implicit, immediate computation. This can be surprising to users since almost all Dask methods are lazily evaluated. Instead I think `head()` and `tail()` should return a Dask DataFrame that users can then call `compute()` on like most other methods.

Since both these methods already have a `compute=` keyword that is `True` by default, I'll suggest we:

1. Deprecate the current `compute=True` default value and inform users that in the future `compute=` will default to `False`
2. After a while, change the default to `compute=False`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.