diff --git a/tests/ast/test_ast_driver.py b/tests/ast/test_ast_driver.py index 96f8374fea..88d2c6b215 100644 --- a/tests/ast/test_ast_driver.py +++ b/tests/ast/test_ast_driver.py @@ -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) diff --git a/tests/integ/modin/test_faster_pandas.py b/tests/integ/modin/test_faster_pandas.py index 4b8c977852..282c6bfc70 100644 --- a/tests/integ/modin/test_faster_pandas.py +++ b/tests/integ/modin/test_faster_pandas.py @@ -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( diff --git a/tests/integ/scala/test_dataframe_reader_suite.py b/tests/integ/scala/test_dataframe_reader_suite.py index 2f5336eb44..6f0cae72e5 100644 --- a/tests/integ/scala/test_dataframe_reader_suite.py +++ b/tests/integ/scala/test_dataframe_reader_suite.py @@ -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, @@ -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()), ] ) diff --git a/tests/integ/scala/test_dataframe_writer_suite.py b/tests/integ/scala/test_dataframe_writer_suite.py index fdf863963b..835a4f3589 100644 --- a/tests/integ/scala/test_dataframe_writer_suite.py +++ b/tests/integ/scala/test_dataframe_writer_suite.py @@ -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 = [ diff --git a/tests/integ/test_df_aggregate.py b/tests/integ/test_df_aggregate.py index 33511044b6..2f25975708 100644 --- a/tests/integ/test_df_aggregate.py +++ b/tests/integ/test_df_aggregate.py @@ -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 @@ -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 """, ) @@ -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 """, ) @@ -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 """, @@ -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""" @@ -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}) """ ), ) @@ -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 @@ -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 """, ) diff --git a/tests/integ/test_lineage.py b/tests/integ/test_lineage.py index 714ebd6773..0d21503bed 100644 --- a/tests/integ/test_lineage.py +++ b/tests/integ/test_lineage.py @@ -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.