Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- `encryption`
- Added support for `Session.directory` and `Session.read.directory` to retrieve the list of all files on a stage with metadata.
- Added support for `DataFrameReader.jdbc`(PrPr) that allows ingesting external data source with jdbc driver.
- Added support for `DataFrame.snow` which will `DataFrame.show`
- Added support for `FileOperation.copy_files` to copy files from a source location to an output stage.

- Added support for the following scalar functions in `functions.py`:
Expand Down
3 changes: 3 additions & 0 deletions src/snowflake/snowpark/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4785,6 +4785,9 @@ def show(
)
)

# Alias "snow" to "show" so snowpark users can let it snow.
snow = show

@deprecated(
version="0.7.0",
extra_warning_text="Use `DataFrame.join_table_function()` instead.",
Expand Down
11 changes: 11 additions & 0 deletions tests/integ/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4932,6 +4932,17 @@ def test_dataframe_result_cache_changing_schema(session):
old_cached_df.show()


def test_let_it_snow(session, capfd):
df = session.create_dataframe([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]).to_df(
["a", "b"]
)
df.snow(n=3)
result_out, err = capfd.readouterr()
df.show(n=3)
expected_out, err = capfd.readouterr()
assert result_out == expected_out


@pytest.mark.skipif(
"config.getoption('local_testing_mode', default=False)",
reason="functions.seq2 is not supported in Local Testing",
Expand Down
Loading