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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.50.0 (TBD)
## 1.50.0 (2026-04-23)

### Snowpark Python API Updates

Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "snowflake-snowpark-python" %}
{% set version = "1.49.0" %}
{% set version = "1.50.0" %}
{% set noarch_build = (os.environ.get('SNOWFLAKE_SNOWPARK_PYTHON_NOARCH_BUILD', 'false')) == 'true' %}
{% set build_number = os.environ.get('SNOWFLAKE_SNOWPARK_PYTHON_BUILD_NUMBER', 0) %}

Expand Down
21 changes: 20 additions & 1 deletion src/snowflake/snowpark/_internal/analyzer/select_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,17 @@ def filter(self, col: Expression) -> "SelectStatement":
can_be_flattened = (
(not self.flatten_disabled)
and can_clause_dependent_columns_flatten(
derive_dependent_columns(col), self.column_states, "filter"
derive_dependent_columns(col),
self.column_states,
"filter",
# In Snowpark Connect compatible mode, the NEW-column branch
# below allows flattening through any subquery. Pass
# subquery_has_limit so that branch can still reject
# flattening across LIMIT/OFFSET, since WHERE cannot cross
# LIMIT/OFFSET without changing semantics.
subquery_has_limit_or_offset=(
self.limit_ is not None or self.offset is not None
),
)
and not has_data_generator_or_window_function_exp(self.projection)
and not (
Expand Down Expand Up @@ -2175,6 +2185,7 @@ def can_clause_dependent_columns_flatten(
dependent_columns: Optional[AbstractSet[str]],
subquery_column_states: ColumnStateDict,
clause: Literal["filter", "sort"],
subquery_has_limit_or_offset: bool = False,
) -> bool:
assert clause in (
"filter",
Expand Down Expand Up @@ -2218,6 +2229,14 @@ def can_clause_dependent_columns_flatten(
and context._snowpark_connect_flatten_select_after_sort
):
return False
# Compatible-mode safety: even though we loosened the
# NEW-column flatten rule above, we must not flatten a
# WHERE across LIMIT/OFFSET on a NEW column — that
# would push the filter in front of the limit and
# change the result set. (Sort has its own
# `not self.limit_` guard at the call site.)
if clause == "filter" and subquery_has_limit_or_offset:
return False

return True

Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/snowpark/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


# Update this for the versions
VERSION = (1, 49, 0)
VERSION = (1, 50, 0)
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.agg.test
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.ai.test
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.col_ilike.test
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.collect.test
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.count.test
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.count2.test
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.create_or_replace.test
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.cross_join.lsuffix.test
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.cross_join.rsuffix.test
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.cross_join.suffix.test
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.describe.test
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.flatten.test
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.indexers.test
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.join.inner.column.test
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.join.inner.column_list.test
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.join.inner.predicate.test
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.join.left_outer.column.test
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.join.right_outer.predicate.test
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.join_table_function.test
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.lateral_join.test
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.natural_join.test
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.pivot.test
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.select_expr.test
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.stat.test
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.to_df.test
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.to_local_iterator.test
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.to_pandas.test
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.to_pandas_batch.test
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.unpivot.test
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/DataFrame.write.test
Original file line number Diff line number Diff line change
Expand Up @@ -6237,6 +6237,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.cube.test
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.distinct.test
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.drop_duplicates.test
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.filter.test
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.getitem.test
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.group_by.test
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.group_by_grouping_sets.test
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.join.asof.test
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
2 changes: 1 addition & 1 deletion tests/ast/data/Dataframe.join.prefix.test
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,6 @@ client_language {
}
client_version {
major: 1
minor: 49
minor: 50
}
id: "\003U\"\366q\366P\346\260\261?\234\303\254\316\353"
Loading
Loading