Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

- Updated README.md to include instructions on how to verify package signatures using `cosign`.

#### Bug Fixes

- Fixed a bug in local testing mode that caused a column to contain None when it should contain 0

### Snowpark pandas API Updates

#### New Features
Expand Down
6 changes: 3 additions & 3 deletions src/snowflake/snowpark/mock/_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1881,9 +1881,9 @@ def flatten_object_cell_func(cell):
# This requires us to wrap the aggregation function with extract logic to handle this special case.
def agg_function(column):
return (
agg_functions[agg_function_name](column.dropna())
if column.any()
else sentinel
sentinel
if column.isnull().all()
else agg_functions[agg_function_name](column.dropna())
)

default = (
Expand Down
11 changes: 11 additions & 0 deletions tests/integ/scala/test_dataframe_aggregate_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ def test_pivot(session):
)


def test_pivot_snow_1869802_repro(session):
df = session.create_dataframe(
[[1, "A", 10], [1, "B", 0], [2, "A", 11], [2, "B", 12]]
)
Utils.check_answer(
df.pivot(pivot_col="_2", values=["A", "B"]).function("min")("_3"),
[Row(1, 10, 0), Row(2, 11, 12)],
False,
)


@pytest.mark.parametrize(
"func,expected",
[
Expand Down
Loading