Skip to content
Merged
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
12 changes: 9 additions & 3 deletions tests/ast/test_ast_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,15 @@ def test_ast(session, tables, test_case, resources_path):
ClearTempTables(actual_message)
ClearTempTables(expected_message)

# If this is not python 3.11+, then for the purposes of the expectation tests we will ignore the line_no
# information since it can be different based on various python bug fixes.
if sys.version_info.minor <= 10:
# Ignore src line/column positions when they are not stable across interpreters:
# - Python < 3.11 had inconsistent frame line numbers (see clear_line_no_in_request).
# - Python 3.14+ can disagree with the golden files (typically produced on 3.11/3.12) for the same
# user code, e.g. due to changes in how frames map to the temp test wrapper (similar to df_copy
# being skipped on 3.12 in load_test_cases).
# TODO SNOW-3414082: Golden-file improvements so we can assert src positions across interpreters without clearing
# them here—e.g. version-specific expected AST files, normalizing only wrapper-related offsets, or
# recording positions relative to trimmed user code.
if sys.version_info < (3, 11) or sys.version_info >= (3, 14):
clear_line_no_in_request(actual_message)
clear_line_no_in_request(expected_message)

Expand Down
4 changes: 4 additions & 0 deletions tests/integ/modin/test_faster_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def test_read_filter_join(session):
assert_frame_equal(snow_result, native_result)


@pytest.mark.xfail(
reason="SNOW-3415226: flaky test_read_filter_join_on_index",
strict=False,
)
@sql_count_checker(query_count=6, join_count=2)
def test_read_filter_join_on_index(session):
with session_parameter_override(
Expand Down
5 changes: 4 additions & 1 deletion tests/integ/scala/test_dataframe_reader_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
TimeType,
VariantType,
)
from snowflake.snowpark._internal.server_connection import MAX_STRING_SIZE
from tests.utils import (
IS_IN_STORED_PROC,
IS_IN_STORED_PROC_LOCALFS,
Expand Down Expand Up @@ -387,7 +388,9 @@ def test_read_csv_with_user_schema_try_cast(session, mode):
try_cast_schema = StructType(
[
StructField("A", LongType()),
StructField("B", StringType()),
StructField(
"B", StringType(length=MAX_STRING_SIZE)
), # Standardizing string size to 128MB for regression test env parity.
StructField("C", DoubleType()),
]
)
Expand Down
10 changes: 6 additions & 4 deletions tests/integ/scala/test_dataframe_writer_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,17 @@ def test_iceberg(session, local_testing_mode):
)
try:
ddl = session._run_query(f"select get_ddl('table', '{table_name}')")
assert (
ddl[0][0] == f"create or replace ICEBERG TABLE {table_name} (\n\t"
f"A STRING,\n\tB LONG,\n\tTS TIMESTAMP_NTZ(9)\n)\n "
# TODO: AWS default may emit TIMESTAMP_NTZ(6) instead of (9).
assert ddl[0][0] in {
f"create or replace ICEBERG TABLE {table_name} (\n\t"
f"A STRING,\n\tB LONG,\n\tTS TIMESTAMP_NTZ({prec})\n)\n "
f"PARTITION BY (A, BUCKET(5, B), TRUNCATE(3, A), DAY(TS))\n "
f"EXTERNAL_VOLUME = 'PYTHON_CONNECTOR_ICEBERG_EXVOL'\n "
f"ICEBERG_VERSION = 3\n "
f"CATALOG = 'SNOWFLAKE'\n "
f"BASE_LOCATION = 'snowpark_python_tests/';"
)
for prec in (9, 6)
}

params = session.sql(f"show parameters for table {table_name}").collect()
target_file_size_params = [
Expand Down
18 changes: 11 additions & 7 deletions tests/integ/test_df_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,10 @@ def test_group_by_agg_sort_filter_sanity(session):
GROUP BY "DEPT"
"""

integer_literal_postfix = (
"" if session.eliminate_numeric_sql_value_cast_enabled else " :: INT"
)

def check_agg_sql(df, expected_sql):
assert Utils.normalize_sql(df.queries["queries"][0]) == Utils.normalize_sql(
expected_sql
Expand All @@ -980,7 +984,7 @@ def check_agg_sql(df, expected_sql):
result1,
f"""
{agg_query_base}
HAVING ("HEADCOUNT" > 1)
HAVING ("HEADCOUNT" > 1{integer_literal_postfix})
ORDER BY "AVG_SALARY" DESC NULLS LAST
""",
)
Expand All @@ -992,7 +996,7 @@ def check_agg_sql(df, expected_sql):
result2,
f"""
{agg_query_base}
HAVING ("HEADCOUNT" > 1)
HAVING ("HEADCOUNT" > 1{integer_literal_postfix})
ORDER BY "AVG_SALARY" DESC NULLS LAST
""",
)
Expand All @@ -1014,7 +1018,7 @@ def check_agg_sql(df, expected_sql):
result3,
f"""
{agg_query_base}
HAVING ("HEADCOUNT" > 1)
HAVING ("HEADCOUNT" > 1{integer_literal_postfix})
ORDER BY "AVG_SALARY" DESC NULLS LAST
LIMIT 2 OFFSET 0
""",
Expand All @@ -1038,7 +1042,7 @@ def check_agg_sql(df, expected_sql):
{agg_query_base}
ORDER BY "AVG_SALARY" DESC NULLS LAST
)
WHERE ("HEADCOUNT" > 1)
WHERE ("HEADCOUNT" > 1{integer_literal_postfix})
"""
if session.sql_simplifier_enabled
else f"""
Expand All @@ -1049,7 +1053,7 @@ def check_agg_sql(df, expected_sql):
ORDER BY "AVG_SALARY" DESC NULLS LAST
)
)
WHERE ("HEADCOUNT" > 1)
WHERE ("HEADCOUNT" > 1{integer_literal_postfix})
"""
),
)
Expand All @@ -1074,7 +1078,7 @@ def check_agg_sql(df, expected_sql):
result5,
f"""
{agg_query_base}
HAVING ("HEADCOUNT" > 1)
HAVING ("HEADCOUNT" > 1{integer_literal_postfix})
ORDER BY "HEADCOUNT" ASC NULLS FIRST,
"AVG_SALARY" DESC NULLS LAST,
"AVG_SALARY" ASC NULLS FIRST
Expand All @@ -1098,7 +1102,7 @@ def check_agg_sql(df, expected_sql):
result6,
f"""
{agg_query_base}
HAVING (("HEADCOUNT" > 1) AND ("AVG_SALARY" > 50000))
HAVING (("HEADCOUNT" > 1{integer_literal_postfix}) AND ("AVG_SALARY" > 50000{integer_literal_postfix}))
ORDER BY "AVG_SALARY" DESC NULLS LAST
""",
)
Expand Down
1 change: 1 addition & 0 deletions tests/integ/test_lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def convert_and_clean(json_str):


@pytest.mark.skipif(not is_pandas_available, reason="pandas is required")
@pytest.mark.skip(reason="SNOW-3413244 lineage test is flaky")
def test_lineage_trace(session):
"""
Tests lineage.trace API on multiple cases.
Expand Down
Loading