Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcovdBoom committed Oct 19, 2024
1 parent f876ba0 commit b356ba8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
19 changes: 7 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@
#### Bug Fixes

- Fixed a bug where `DataFrame.alias` raises `KeyError` for input column name.

#### Bug Fixes
- Fixed a bug where `to_csv` on Snowflake stage fails when data contains empty strings.
- Fixed a bug where nullable columns were annotated wrongly.
- Fixed a bug where the `date_add` and `date_sub` functions failed for `NULL` values.
- Fixed a bug where `equal_null` could fail inside a merge statement.
- Fixed a bug where `row_number` could fail inside a Window function.
- Fixed a bug where `Table.update` and `Table.merge` could fail if the target table's
index was not the default `RangeIndex`.


## 1.23.0 (2024-10-09)

Expand Down Expand Up @@ -121,16 +126,6 @@
- Fixed a bug where `pd.to_numeric()` would leave `Timedelta` inputs as `Timedelta` instead of converting them to integers.
- Fixed `loc` set when setting a single row, or multiple rows, of a DataFrame with a Series value.

### Snowpark Local Testing Updates

#### Bug Fixes

- Fixed a bug where nullable columns were annotated wrongly.
- Fixed a bug where the `date_add` and `date_sub` functions failed for `NULL` values.
- Fixed a bug where `equal_null` could fail inside a merge statement.
- Fixed a bug where `row_number` could fail inside a Window function.
- Fixed a bug where updates could fail when the source is the result of a join.


## 1.22.1 (2024-09-11)
This is a re-release of 1.22.0. Please refer to the 1.22.0 release notes for detailed release content.
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/snowpark/mock/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def read_table(self, name: Union[str, Iterable[str]]) -> TableEmulator:
name, current_schema, current_database
)
if qualified_name in self.table_registry:
return copy(self.table_registry[qualified_name])
return copy(self.table_registry[qualified_name].reset_index(drop=True))
else:
raise SnowparkLocalTestingException(
f"Object '{name}' does not exist or not authorized."
Expand Down
24 changes: 24 additions & 0 deletions tests/integ/scala/test_update_delete_merge_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,3 +696,27 @@ def test_snow_1694649_repro_merge_with_equal_null(session):
Row(0, "a"),
Row(1, "b"),
]


@pytest.mark.skipif(
not installed_pandas,
reason="Test requires pandas.",
)
def test_snow_1707286_repro_merge_with_(session):
import pandas as pd

df1 = session.create_dataframe(pd.DataFrame({"A": [1, 2, 3, 4, 5]}))
df2 = session.create_dataframe(pd.DataFrame({"A": [3, 4]}))

table = df1.where(col("A") > 2).cache_result()

table.update(
assignments={"A": lit(9)},
condition=table["A"] == df2["A"],
source=df2,
)
assert table.order_by("A").collect() == [
Row(0, "9"),
Row(1, "9"),
Row(2, "5"),
]

0 comments on commit b356ba8

Please sign in to comment.