-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Labels
bugSomething isn't workingSomething isn't workingstatus-triage_doneInitial triage done, will be further handled by the driver teamInitial triage done, will be further handled by the driver team
Description
Please answer these questions before submitting your issue. Thanks!
-
What version of Python are you using?
Python 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
-
What operating system and processor architecture are you using?
Windows-10-10.0.22631-SP0
-
What are the component versions in the environment (
pip freeze
)?pandas==2.2.2
snowflake-snowpark-python==1.22.1 -
What did you do?
from snowflake.snowpark import Session
from snowflake.snowpark.functions import lit
mock_session = Session.builder.config("local_testing", True).create()
test_data = mock_session.create_dataframe(pd.DataFrame({"a": [1, 2]}))
df1 = mock_session.create_dataframe(pd.DataFrame({"A": [0, 1], "B": ['a', 'b']}))
df2 = mock_session.create_dataframe(pd.DataFrame({"A": [0, 1], "B": ['a', 'c']}))
anti = df1.join(df2, on=["A", "B"], how="anti")
anti.show() # Has only 1 row
# This update should only update 1 row in df1
result = df1.update(
assignments={"B": lit("f")},
condition=(df1["A"] == anti["A"]) & (df1["B"] == anti["B"]),
source=anti,
)
print(result) # UpdateResult(rows_updated=2, multi_joined_rows_updated=0)
mock_session.table(df1.table_name).show() # Two rows are updated
-
What did you expect to see?
The updated table should have only 1 updated row. Instead, both rows are updated.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstatus-triage_doneInitial triage done, will be further handled by the driver teamInitial triage done, will be further handled by the driver team