|
22 | 22 | from snowflake.snowpark.functions import call_udf, col, count_distinct, sproc, udf |
23 | 23 | from snowflake.snowpark.context import _ANACONDA_SHARED_REPOSITORY |
24 | 24 | from snowflake.snowpark.types import DateType, StringType |
25 | | -from tests.utils import IS_IN_STORED_PROC, TempObjectType, TestFiles, Utils |
| 25 | +from tests.utils import IS_IN_STORED_PROC, TempObjectType, TestFiles, Utils, IS_PY314 |
26 | 26 |
|
27 | 27 | pytestmark = pytest.mark.xfail( |
28 | 28 | "config.getoption('local_testing_mode', default=False)", |
@@ -347,21 +347,23 @@ def test_add_packages_negative(session, caplog): |
347 | 347 | assert "InvalidRequirement" in str(ex_info) |
348 | 348 |
|
349 | 349 | session.custom_package_usage_config = {"enabled": True} |
350 | | - with patch.object(session, "_is_anaconda_terms_acknowledged", lambda: True): |
351 | | - with pytest.raises(RuntimeError, match="Pip failed with return code 1"): |
352 | | - session.add_packages("dateutil") |
353 | | - |
354 | | - with patch.object(session, "_is_anaconda_terms_acknowledged", lambda: False): |
355 | | - with pytest.raises(RuntimeError, match="Cannot add package dateutil"): |
356 | | - session.add_packages("dateutil") |
357 | | - |
358 | | - # Verify multiple errors can be raised at once |
359 | | - with patch.object(session, "_is_anaconda_terms_acknowledged", lambda: False): |
360 | | - with pytest.raises( |
361 | | - RuntimeError, |
362 | | - match="Cannot add package dateutil.*Cannot add package functools", |
363 | | - ): |
364 | | - session.add_packages("dateutil", "functools") |
| 350 | + # These errors are not raised with Python 3.14 since it uses the pypi repository by default. |
| 351 | + if not IS_PY314: |
| 352 | + with patch.object(session, "_is_anaconda_terms_acknowledged", lambda: True): |
| 353 | + with pytest.raises(RuntimeError, match="Pip failed with return code 1"): |
| 354 | + session.add_packages("dateutil") |
| 355 | + |
| 356 | + with patch.object(session, "_is_anaconda_terms_acknowledged", lambda: False): |
| 357 | + with pytest.raises(RuntimeError, match="Cannot add package dateutil"): |
| 358 | + session.add_packages("dateutil") |
| 359 | + |
| 360 | + # Verify multiple errors can be raised at once |
| 361 | + with patch.object(session, "_is_anaconda_terms_acknowledged", lambda: False): |
| 362 | + with pytest.raises( |
| 363 | + RuntimeError, |
| 364 | + match="Cannot add package dateutil.*Cannot add package functools", |
| 365 | + ): |
| 366 | + session.add_packages("dateutil", "functools") |
365 | 367 |
|
366 | 368 | with pytest.raises(ValueError, match="is already added"): |
367 | 369 | with caplog.at_level(logging.WARNING): |
@@ -464,6 +466,10 @@ def test_add_requirements_twice_should_fail_if_packages_are_different( |
464 | 466 | IS_IN_STORED_PROC, |
465 | 467 | reason="Subprocess calls are not allowed within stored procedures.", |
466 | 468 | ) |
| 469 | +@pytest.mark.skipif( |
| 470 | + IS_PY314, |
| 471 | + reason="Python 3.14 uses pypi repository", |
| 472 | +) |
467 | 473 | def test_add_unsupported_requirements_should_fail_if_custom_packages_upload_enabled_not_switched_on( |
468 | 474 | session, resources_path |
469 | 475 | ): |
@@ -519,6 +525,10 @@ def test_urllib() -> str: |
519 | 525 | IS_IN_STORED_PROC, |
520 | 526 | reason="Subprocess calls are not allowed within stored procedures.", |
521 | 527 | ) |
| 528 | +@pytest.mark.skipif( |
| 529 | + IS_PY314, |
| 530 | + reason="Python 3.14 uses pypi repository", |
| 531 | +) |
522 | 532 | def test_add_unsupported_packages_should_fail_if_custom_packages_upload_enabled_not_switched_on( |
523 | 533 | session, |
524 | 534 | ): |
@@ -991,6 +1001,10 @@ def get_skfuzzy_version() -> str: |
991 | 1001 | IS_IN_STORED_PROC, |
992 | 1002 | reason="Subprocess calls are not allowed within stored procedures.", |
993 | 1003 | ) |
| 1004 | +@pytest.mark.skipif( |
| 1005 | + IS_PY314, |
| 1006 | + reason="Python 3.14 uses pypi repository", |
| 1007 | +) |
994 | 1008 | def test_add_requirements_unsupported_with_cache_path_negative( |
995 | 1009 | session, resources_path, temporary_stage |
996 | 1010 | ): |
|
0 commit comments