diff --git a/src/conftest.py b/src/conftest.py index f33dbb32e2..5d6ec2587e 100644 --- a/src/conftest.py +++ b/src/conftest.py @@ -2,7 +2,6 @@ # # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. # -import datetime import doctest import logging import os @@ -101,16 +100,6 @@ def pytest_collection_modifyitems(config, items): This function is used to skip some doctests on certain conditions. For example, some functions in PrPr might not be available on Azure and GCP. """ - # Mark flaky tests as xfail for a time - if datetime.date.today() <= datetime.date(2026, 6, 4): - xfail_ai = pytest.mark.xfail( - reason="dataframe_ai_functions doctests flaky due to infrastructure issues", - strict=False, - ) - for item in items: - if isinstance(item, DoctestItem) and "dataframe_ai" in item.name: - item.add_marker(xfail_ai) - host = ( conn_params.get("host") or conn_params.get("HOST") or conn_params.get("account") ) diff --git a/tests/integ/test_dataframe_ai.py b/tests/integ/test_dataframe_ai.py index fb262af083..89086099c3 100644 --- a/tests/integ/test_dataframe_ai.py +++ b/tests/integ/test_dataframe_ai.py @@ -2,10 +2,10 @@ # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. # -import datetime import json import pytest from snowflake.snowpark.functions import ai_complete, ai_extract, col, lit, to_file +from snowflake.snowpark.types import StringType from tests.utils import RUNNING_ON_JENKINS, TestFiles, Utils from snowflake.snowpark.exceptions import SnowparkSQLException @@ -14,11 +14,6 @@ "config.getoption('local_testing_mode', default=False)", reason="AI functions are not yet supported in local testing mode.", ), - pytest.mark.xfail( - datetime.date.today() <= datetime.date(2026, 6, 4), - reason="AI tests flaky due to infrastructure issues", - strict=False, - ), ] @@ -39,7 +34,9 @@ def test_dataframe_ai_complete_with_named_placeholders(session): prompt="Analyze this {category} product review: '{review}' with rating {rating}/5. What is the sentiment?", input_columns={ "review": col("review"), - "rating": col("rating"), + # Docs allow NUMBER prompt args; runtime currently rejects them with + # "unsupported argument type". Cast until the server-side bug is fixed. + "rating": col("rating").cast(StringType()), "category": col("category"), }, output_column="sentiment_analysis",