Skip to content

Commit 5a01033

Browse files
authored
SNOW-938998: reenble gcp tests (#1090)
1 parent 350b342 commit 5a01033

File tree

2 files changed

+9
-55
lines changed

2 files changed

+9
-55
lines changed

.github/workflows/precommit.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
run: python -m pip install -U setuptools pip wheel
102102
- name: Install tox
103103
run: python -m pip install tox
104-
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') && contains('macos', matrix.os.download_name) }}
104+
- if: ${{ contains('macos', matrix.os.download_name) }}
105105
name: Run doctests
106106
run: python -m tox -e "py${PYTHON_VERSION}-doctest-notudf-ci"
107107
env:
@@ -112,25 +112,14 @@ jobs:
112112
# Specify SNOWFLAKE_IS_PYTHON_RUNTIME_TEST: 1 when adding >= python3.12 with no server-side support
113113
# For example, see https://github.com/snowflakedb/snowpark-python/pull/681
114114
shell: bash
115-
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') }}
116-
name: Run tests (excluding doctests)
115+
- name: Run tests (excluding doctests)
117116
run: python -m tox -e "py${PYTHON_VERSION/\./}-notdoctest-ci"
118117
env:
119118
PYTHON_VERSION: ${{ matrix.python-version }}
120119
cloud_provider: ${{ matrix.cloud-provider }}
121120
PYTEST_ADDOPTS: --color=yes --tb=short
122121
TOX_PARALLEL_NO_SPINNER: 1
123122
shell: bash
124-
- if: ${{ matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp' }}
125-
name: Run tests (excluding udf and doctest tests)
126-
run: python -m tox -e "py${PYTHON_VERSION/\./}-notudfdoctest"
127-
env:
128-
PYTHON_VERSION: ${{ matrix.python-version }}
129-
cloud_provider: ${{ matrix.cloud-provider }}
130-
PYTEST_ADDOPTS: --color=yes --tb=short
131-
TOX_PARALLEL_NO_SPINNER: 1
132-
SNOWFLAKE_IS_PYTHON_RUNTIME_TEST: 1
133-
shell: bash
134123
- name: Combine coverages
135124
run: python -m tox -e coverage --skip-missing-interpreters false
136125
shell: bash
@@ -222,7 +211,7 @@ jobs:
222211
run: python -m pip install -U setuptools pip wheel
223212
- name: Install tox
224213
run: python -m pip install tox
225-
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') && contains('macos', matrix.os.download_name) }}
214+
- if: ${{ contains('macos', matrix.os.download_name) }}
226215
name: Run doctests
227216
run: python -m tox -e "py${PYTHON_VERSION}-doctest-notudf-ci"
228217
env:
@@ -231,25 +220,14 @@ jobs:
231220
PYTEST_ADDOPTS: --color=yes --tb=short --disable_sql_simplifier
232221
TOX_PARALLEL_NO_SPINNER: 1
233222
shell: bash
234-
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') }}
235-
name: Run tests (excluding doctests)
223+
- name: Run tests (excluding doctests)
236224
run: python -m tox -e "py${PYTHON_VERSION/\./}-notdoctest-ci"
237225
env:
238226
PYTHON_VERSION: ${{ matrix.python-version }}
239227
cloud_provider: ${{ matrix.cloud-provider }}
240228
PYTEST_ADDOPTS: --color=yes --tb=short --disable_sql_simplifier
241229
TOX_PARALLEL_NO_SPINNER: 1
242230
shell: bash
243-
- if: ${{ matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp' }}
244-
name: Run tests (excluding udf and doctest tests)
245-
run: python -m tox -e "py${PYTHON_VERSION/\./}-notudfdoctest"
246-
env:
247-
PYTHON_VERSION: ${{ matrix.python-version }}
248-
cloud_provider: ${{ matrix.cloud-provider }}
249-
PYTEST_ADDOPTS: --color=yes --tb=short --disable_sql_simplifier
250-
TOX_PARALLEL_NO_SPINNER: 1
251-
SNOWFLAKE_IS_PYTHON_RUNTIME_TEST: 1
252-
shell: bash
253231
- name: Combine coverages
254232
run: python -m tox -e coverage --skip-missing-interpreters false
255233
shell: bash

tests/integ/test_packaging.py

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -762,37 +762,13 @@ def test_add_requirements_with_empty_stage_as_cache_path(
762762

763763
udf_name = Utils.random_name_for_temp_object(TempObjectType.FUNCTION)
764764

765-
try:
766-
767-
@udf(name=udf_name, packages=["snowflake-snowpark-python==1.8.0"])
768-
def get_numpy_pandas_version() -> str:
769-
import snowflake.snowpark as snowpark
770-
771-
return f"{snowpark.__version__}"
772-
773-
Utils.check_answer(session.sql(f"select {udf_name}()"), [Row("1.8.0")])
774-
except RuntimeError as e:
775-
# this is to temporarily bypass the issue that snowflake-snowpark-python==1.8.0 is not available on gcp
776-
# for gcp, python == 3.11, we skip the test
777-
# for gcp, python < 3.11, we use older snowpark-python lib
778-
assert (
779-
"Unable to auto-upload packages: ['snowflake-snowpark-python==1.8.0']"
780-
in str(e)
781-
)
782-
system_version = f"{sys.version_info[0]}.{sys.version_info[1]}"
783-
if system_version == "3.11":
784-
pytest.xfail(
785-
"SNOW-938998: package snowflake-snowpark-python 1.8.0 is not available on gcp yet"
786-
)
787-
else:
788-
789-
@udf(name=udf_name, packages=["snowflake-snowpark-python==1.3.0"])
790-
def get_numpy_pandas_version() -> str:
791-
import snowflake.snowpark as snowpark
765+
@udf(name=udf_name, packages=["snowflake-snowpark-python==1.8.0"])
766+
def get_numpy_pandas_version() -> str:
767+
import snowflake.snowpark as snowpark
792768

793-
return f"{snowpark.__version__}"
769+
return f"{snowpark.__version__}"
794770

795-
Utils.check_answer(session.sql(f"select {udf_name}()"), [Row("1.3.0")])
771+
Utils.check_answer(session.sql(f"select {udf_name}()"), [Row("1.8.0")])
796772

797773

798774
@pytest.mark.udf

0 commit comments

Comments
 (0)