Skip to content

Commit

Permalink
doctest stable api
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Nov 1, 2024
1 parent 2592495 commit b099f87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion narwhals/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def to_native(self: Self) -> DataFrameT:
│ 2 ┆ 7.0 ┆ b │
│ 3 ┆ 8.0 ┆ c │
└─────┴─────┴─────┘
>>> nw.from_native(df_pa).to_native()
>>> nw.from_native(df_pa).to_native() # doctest:+SKIP
pyarrow.Table
foo: int64
bar: double
Expand Down
14 changes: 7 additions & 7 deletions narwhals/stable/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,12 @@ def to_native(self: Self) -> IntoDataFrameT:
Calling `to_native` on a Narwhals DataFrame returns the native object:
>>> nw.from_native(df_pd).to_native()
>>> nw.from_native(df_pd).to_native() # doctest:+SKIP
foo bar ham
0 1 6.0 a
1 2 7.0 b
2 3 8.0 c
>>> nw.from_native(df_pl).to_native()
>>> nw.from_native(df_pl).to_native() # doctest:+SKIP
shape: (3, 3)
┌─────┬─────┬─────┐
│ foo ┆ bar ┆ ham │
Expand All @@ -361,7 +361,7 @@ def to_native(self: Self) -> IntoDataFrameT:
│ 2 ┆ 7.0 ┆ b │
│ 3 ┆ 8.0 ┆ c │
└─────┴─────┴─────┘
>>> nw.from_native(df_pa).to_native()
>>> nw.from_native(df_pa).to_native() # doctest:+SKIP
pyarrow.Table
foo: int64
bar: double
Expand Down Expand Up @@ -449,12 +449,12 @@ def to_native(self: Self) -> IntoFrameT:
Calling `to_native` on a Narwhals DataFrame returns the native object:
>>> nw.from_native(df_pd).lazy().to_native()
>>> nw.from_native(df_pd).lazy().to_native() # doctest:+SKIP
foo bar ham
0 1 6.0 a
1 2 7.0 b
2 3 8.0 c
>>> nw.from_native(df_pl).to_native().collect()
>>> nw.from_native(df_pl).to_native().collect() # doctest:+SKIP
shape: (3, 3)
┌─────┬─────┬─────┐
│ foo ┆ bar ┆ ham │
Expand Down Expand Up @@ -609,12 +609,12 @@ def to_native(self: Self) -> Any:
We can then pass either pandas or Polars to `func`:
>>> func(s_pd)
>>> func(s_pd) # doctest:+SKIP
0 1
1 2
2 3
dtype: int64
>>> func(s_pl) # doctest: +NORMALIZE_WHITESPACE
>>> func(s_pl) # doctest:+SKIP
shape: (3,)
Series: '' [i64]
[
Expand Down

0 comments on commit b099f87

Please sign in to comment.