Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1635365: Update snowpark pandas imports in method documentation #2204

Merged
merged 5 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/snowflake/snowpark/modin/plugin/docstrings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,6 @@ def nunique():

Examples
--------
>>> import snowflake.snowpark.modin.pandas as pd
>>> df = pd.DataFrame({'A': [4, 5, 6], 'B': [4, 1, 1]})
>>> df.nunique()
A 3
Expand Down
1 change: 0 additions & 1 deletion src/snowflake/snowpark/modin/plugin/docstrings/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3800,7 +3800,6 @@ def nunique():

Examples
--------
>>> import snowflake.snowpark.modin.pandas as pd
>>> import numpy as np
>>> s = pd.Series([1, 3, 5, 7, 7])
>>> s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def read_snowflake(
will have a default index from 0 to n-1, where n is the number of rows in the table,
and have all columns in the Snowflake table as data columns.

>>> import snowflake.snowpark.modin.pandas as pd
>>> import modin.pandas as pd
>>> import snowflake.snowpark.modin.plugin
>>> pd.read_snowflake(table_name) # doctest: +NORMALIZE_WHITESPACE
A B C
0 1 2 3
Expand Down Expand Up @@ -171,7 +172,8 @@ def read_snowflake(
- When ``index_col`` is not specified, a Snowpark pandas DataFrame
will have a default index from 0 to n-1, where n is the number of rows in the table.

>>> import snowflake.snowpark.modin.pandas as pd
>>> import modin.pandas as pd
>>> import snowflake.snowpark.modin.plugin
>>> pd.read_snowflake(f"SELECT * FROM {table_name}") # doctest: +NORMALIZE_WHITESPACE
A B C
0 1 2 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ def read_csv(
>>> with open(f'{temp_dir_name}/data.csv', 'w') as f:
... writer = csv.writer(f)
... writer.writerows([['c1','c2','c3'], [1,2,3], [4,5,6], [7,8,9]])
>>> import snowflake.snowpark.modin.pandas as pd
>>> import modin.pandas as pd
>>> import snowflake.snowpark.modin.plugin
>>> df = pd.read_csv(f'{temp_dir_name}/data.csv')
>>> df
c1 c2 c3
Expand Down Expand Up @@ -369,7 +370,7 @@ def read_json(
path_or_buf: FilePath,
*,
orient: Optional[str] = None,
typ: Optional[Literal["frame", "series"]] = None,
typ: Optional[Literal["frame", "series"]] = "frame",
sfc-gh-azhan marked this conversation as resolved.
Show resolved Hide resolved
dtype: Optional[DtypeArg] = None,
convert_axes: Optional[bool] = None,
convert_dates: Optional[Union[bool, list[str]]] = None,
Expand Down Expand Up @@ -489,7 +490,8 @@ def read_json(
>>> with open(f'{temp_dir_name}/snowpark_pandas.json', 'w') as f:
... json.dump(data, f)

>>> import snowflake.snowpark.modin.pandas as pd
>>> import modin.pandas as pd
>>> import snowflake.snowpark.modin.plugin
>>> df = pd.read_json(f'{temp_dir_name}/snowpark_pandas.json')
>>> df
A B C
Expand Down
4 changes: 2 additions & 2 deletions src/snowflake/snowpark/modin/plugin/io/snow_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def read_json(
path_or_buf: FilePath,
*,
orient: Optional[str] = None,
typ: Optional[Literal["frame", "series"]] = None,
typ: Optional[Literal["frame", "series"]] = "frame",
dtype: Optional[DtypeArg] = None,
convert_axes: Optional[bool] = None,
convert_dates: Optional[Union[bool, list[str]]] = None,
Expand Down Expand Up @@ -463,7 +463,7 @@ def read_json(
)

error_not_implemented_parameter("orient", orient is not None)
error_not_implemented_parameter("typ", typ is not None)
error_not_implemented_parameter("typ", typ != "frame")
error_not_implemented_parameter("dtype", dtype is not None)
error_not_implemented_parameter("convert_axes", convert_axes is not None)
error_not_implemented_parameter("convert_dates", convert_dates is not None)
Expand Down
Loading