Skip to content
Open
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
38 changes: 31 additions & 7 deletions tests/integ/test_dataframe_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved.
#

import datetime
import json
import pytest
from snowflake.snowpark.functions import ai_complete, col, lit, to_file
from snowflake.snowpark.row import Row
from tests.utils import TestFiles, Utils
from tests.utils import TestFiles, Utils, running_on_jenkins
from snowflake.snowpark.exceptions import SnowparkSQLException


Expand All @@ -16,11 +15,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,
),
]


Expand Down Expand Up @@ -1294,6 +1288,11 @@ def test_dataframe_ai_count_tokens_error_handling(session):
)


@pytest.mark.xfail(
running_on_jenkins(),
reason="SNOW-3664377: AI_SPLIT tests fail due to server-side anaconda repository validation error",
strict=True,
)
def test_dataframe_ai_split_text_markdown_header_basic(session):
"""Test DataFrame.ai.split_text_markdown_header with basic usage."""
# Create a DataFrame with Markdown text
Expand Down Expand Up @@ -1369,6 +1368,11 @@ def test_dataframe_ai_split_text_markdown_header_basic(session):
]


@pytest.mark.xfail(
running_on_jenkins(),
reason="SNOW-3664377: AI_SPLIT tests fail due to server-side anaconda repository validation error",
strict=True,
)
def test_dataframe_ai_split_text_markdown_header_default_output(session):
"""Test DataFrame.ai.split_text_markdown_header with default output column."""
df = session.create_dataframe(
Expand Down Expand Up @@ -1401,6 +1405,11 @@ def test_dataframe_ai_split_text_markdown_header_error_handling(session):
)


@pytest.mark.xfail(
running_on_jenkins(),
reason="SNOW-3664377: AI_SPLIT tests fail due to server-side anaconda repository validation error",
strict=True,
)
def test_dataframe_ai_split_text_recursive_character_basic(session):
"""Test DataFrame.ai.split_text_recursive_character with basic usage."""
long_text = """This is a long document with multiple sentences. It contains various information
Expand Down Expand Up @@ -1440,6 +1449,11 @@ def test_dataframe_ai_split_text_recursive_character_basic(session):
]


@pytest.mark.xfail(
running_on_jenkins(),
reason="SNOW-3664377: AI_SPLIT tests fail due to server-side anaconda repository validation error",
strict=True,
)
def test_dataframe_ai_split_text_recursive_character_markdown_format(session):
"""Test DataFrame.ai.split_text_recursive_character with markdown format."""
markdown_text = """# Main Title
Expand Down Expand Up @@ -1497,6 +1511,11 @@ def hello():
]


@pytest.mark.xfail(
running_on_jenkins(),
reason="SNOW-3664377: AI_SPLIT tests fail due to server-side anaconda repository validation error",
strict=True,
)
def test_dataframe_ai_split_text_recursive_character_custom_separators(session):
"""Test DataFrame.ai.split_text_recursive_character with custom separators."""
code_text = """def function_one():
Expand Down Expand Up @@ -1538,6 +1557,11 @@ def function_three():
]


@pytest.mark.xfail(
running_on_jenkins(),
reason="SNOW-3664377: AI_SPLIT tests fail due to server-side anaconda repository validation error",
strict=True,
)
def test_dataframe_ai_split_text_recursive_character_default_output(session):
"""Test DataFrame.ai.split_text_recursive_character with default output column."""
df = session.create_dataframe(
Expand Down
Loading