Skip to content

Commit

Permalink
skip doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-joshi committed Oct 22, 2024
1 parent baced1e commit ce6755c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/snowflake/snowpark/modin/plugin/docstrings/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ def aggregate():
agg = aggregate

def apply():
# TODO SNOW-1739034 unskip UDF tests when pandas 2.2.3 is available in anaconda
"""
Apply a function along an axis of the DataFrame.
Expand Down Expand Up @@ -821,15 +822,15 @@ def apply():
Using a reducing function on ``axis=1``:
>>> df.apply(np.sum, axis=1)
>>> df.apply(np.sum, axis=1) # doctest: +SKIP
0 2
1 10
2 13
dtype: int64
Returning a list-like object will result in a Series:
>>> df.apply(lambda x: [1, 2], axis=1)
>>> df.apply(lambda x: [1, 2], axis=1) # doctest: +SKIP
0 [1, 2]
1 [1, 2]
2 [1, 2]
Expand Down Expand Up @@ -1022,6 +1023,7 @@ def keys():
"""

def transform():
# TODO SNOW-1739034 unskip UDF tests when pandas 2.2.3 is available in anaconda
"""
Call ``func`` on self producing a Snowpark pandas DataFrame with the same axis shape as self.
Expand Down Expand Up @@ -1055,15 +1057,15 @@ def transform():
0 1 3
1 2 4
2 3 5
>>> df.transform(lambda x: x + 1, axis=1)
>>> df.transform(lambda x: x + 1, axis=1) # doctest: +SKIP
col1 col2
0 2 4
1 3 5
2 4 6
Apply a numpy ufunc to every value in the DataFrame.
>>> df.transform(np.square, axis=1)
>>> df.transform(np.square, axis=1) # doctest: +SKIP
col1 col2
0 1 9
1 4 16
Expand Down
10 changes: 6 additions & 4 deletions src/snowflake/snowpark/modin/plugin/docstrings/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ def cummax():
"""

def apply():
# TODO SNOW-1739034 unskip UDF tests when pandas 2.2.3 is available in anaconda
"""
Apply function ``func`` group-wise and combine the results together.
Expand Down Expand Up @@ -1050,7 +1051,7 @@ def apply():
its argument and returns a DataFrame. `apply` combines the result for
each group together into a new DataFrame:
>>> g1[['B', 'C']].apply(lambda x: x.select_dtypes('number') / x.select_dtypes('number').sum()) # doctest: +NORMALIZE_WHITESPACE
>>> g1[['B', 'C']].apply(lambda x: x.select_dtypes('number') / x.select_dtypes('number').sum()) # doctest: +SKIP
B C
0.0 0.333333 0.4
1.0 0.666667 0.6
Expand All @@ -1059,7 +1060,7 @@ def apply():
In the above, the groups are not part of the index. We can have them included
by using ``g2`` where ``group_keys=True``:
>>> g2[['B', 'C']].apply(lambda x: x.select_dtypes('number') / x.select_dtypes('number').sum()) # doctest: +NORMALIZE_WHITESPACE
>>> g2[['B', 'C']].apply(lambda x: x.select_dtypes('number') / x.select_dtypes('number').sum()) # doctest: +SKIP
B C
A
a 0.0 0.333333 0.4
Expand Down Expand Up @@ -1942,6 +1943,7 @@ def cov():
pass

def transform():
# TODO SNOW-1739034 unskip UDF tests when pandas 2.2.3 is available in anaconda
"""
Call function producing a same-indexed DataFrame on each group.
Expand Down Expand Up @@ -2011,7 +2013,7 @@ def transform():
i X 9 90 -9
j Y 10 10 -10
>>> df.groupby("col1", dropna=True).transform(lambda df, n: df.head(n), n=2)
>>> df.groupby("col1", dropna=True).transform(lambda df, n: df.head(n), n=2) # doctest: +SKIP
col2 col3 col4
a 1.0 40.0 -1.0
b NaN NaN NaN
Expand All @@ -2024,7 +2026,7 @@ def transform():
i NaN NaN NaN
j 10.0 10.0 -10.0
>>> df.groupby("col1", dropna=False).transform("mean")
>>> df.groupby("col1", dropna=False).transform("mean") # doctest: +SKIP
col2 col3 col4
a 2.50 25.0 -2.50
b 5.00 65.0 -5.00
Expand Down

0 comments on commit ce6755c

Please sign in to comment.