From 6fb25158926b39a66c95e7d33124d1c3e748f419 Mon Sep 17 00:00:00 2001 From: Shixuan Fan Date: Fri, 1 Mar 2024 15:30:24 -0800 Subject: [PATCH] Merge gate fix (#1282) Description Our merge gate is broken because of a new python-dateutil release. To fix merge gate, there are two changes - We don't check python-dateutil is in package set. The reason is that the latest version of python-dateutil is not on Snowflake yet, and as a result, we use custom package and not specify this package in session. - We add session.custom_package_usage_config for the python-dateutil related doc test. Testing Merge gate passing --- src/snowflake/snowpark/session.py | 1 + tests/integ/test_packaging.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snowflake/snowpark/session.py b/src/snowflake/snowpark/session.py index 4eeaae33fdb..6bdfbdaf2b7 100644 --- a/src/snowflake/snowpark/session.py +++ b/src/snowflake/snowpark/session.py @@ -918,6 +918,7 @@ def add_packages( >>> # add numpy with the latest version on Snowflake Anaconda >>> # and pandas with the version "1.3.*" >>> # and dateutil with the local version in your environment + >>> session.custom_package_usage_config = {"enabled": True} # This is added because latest dateutil is not in snowflake yet >>> session.add_packages("numpy", "pandas==1.5.*", dateutil) >>> @udf ... def get_package_name_udf() -> list: diff --git a/tests/integ/test_packaging.py b/tests/integ/test_packaging.py index d72a8457248..f1b738313a3 100644 --- a/tests/integ/test_packaging.py +++ b/tests/integ/test_packaging.py @@ -1007,7 +1007,6 @@ def import_scikit_fuzzy() -> str: assert "matplotlib" in package_set assert "pyyaml" in package_set assert "pandas" in package_set - assert "python-dateutil" in package_set assert "scikit-learn" in package_set assert "six" in package_set