Skip to content

Commit

Permalink
add more notes on fetch in python docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Nov 26, 2021
1 parent 5eec42c commit 4299fce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions py-polars/polars/internals/lazy_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ def collect(
"""
Collect into a DataFrame.
Note: use `fetch` if you want to run this query on the first `n` rows only.
This can be a huge time saver in debugging queries.
Parameters
----------
type_coercion
Expand Down Expand Up @@ -739,9 +742,12 @@ def limit(self, n: int) -> "LazyFrame":

def head(self, n: int) -> "LazyFrame":
"""
Get the first `n` rows of the DataFrame
Note if you don't want the rows to be scanned,
use the `fetch` operation.
Gets the first `n` rows of the DataFrame. You probably don't want to use this!
Consider using the `fetch` operation. The `fetch` operation will truly load the first `n`
rows lazily.
This operation instead loads all the rows and only applies the `head` at the end.
Parameters
----------
Expand Down

0 comments on commit 4299fce

Please sign in to comment.