Skip to content

Commit

Permalink
doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jan 1, 2025
1 parent 90d6c2f commit 81234ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions narwhals/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3619,11 +3619,12 @@ def collect(self) -> DataFrame[Any]:
... }
... )
>>> lf = nw.from_native(lf_pl)
>>> lf
┌───────────────────────────────────────┐
| Narwhals LazyFrame |
| Use `.to_native` to see native output |
└───────────────────────────────────────┘
>>> lf # doctest:+ELLIPSIS
┌─────────────────────────────┐
| Narwhals LazyFrame |
|-----------------------------|
|<LazyFrame at ...
└─────────────────────────────┘
>>> df = lf.group_by("a").agg(nw.all().sum()).collect()
>>> df.to_native().sort("a")
shape: (3, 3)
Expand Down
11 changes: 6 additions & 5 deletions narwhals/stable/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,12 @@ def collect(self) -> DataFrame[Any]:
... }
... )
>>> lf = nw.from_native(lf_pl)
>>> lf
┌───────────────────────────────────────┐
| Narwhals LazyFrame |
| Use `.to_native` to see native output |
└───────────────────────────────────────┘
>>> lf # doctest:+ELLIPSIS
┌─────────────────────────────┐
| Narwhals LazyFrame |
|-----------------------------|
|<LazyFrame at ...
└─────────────────────────────┘
>>> df = lf.group_by("a").agg(nw.all().sum()).collect()
>>> df.to_native().sort("a")
shape: (3, 3)
Expand Down

0 comments on commit 81234ea

Please sign in to comment.