Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-938998: reenable gcp tests after packages are ready #1090

Merged
Merged
Show file tree
Hide file tree
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
30 changes: 4 additions & 26 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
run: python -m pip install -U setuptools pip wheel
- name: Install tox
run: python -m pip install tox
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') && contains('macos', matrix.os.download_name) }}
- if: ${{ contains('macos', matrix.os.download_name) }}
name: Run doctests
run: python -m tox -e "py${PYTHON_VERSION}-doctest-notudf-ci"
env:
Expand All @@ -112,25 +112,14 @@ jobs:
# Specify SNOWFLAKE_IS_PYTHON_RUNTIME_TEST: 1 when adding >= python3.12 with no server-side support
# For example, see https://github.com/snowflakedb/snowpark-python/pull/681
shell: bash
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') }}
name: Run tests (excluding doctests)
- name: Run tests (excluding doctests)
run: python -m tox -e "py${PYTHON_VERSION/\./}-notdoctest-ci"
env:
PYTHON_VERSION: ${{ matrix.python-version }}
cloud_provider: ${{ matrix.cloud-provider }}
PYTEST_ADDOPTS: --color=yes --tb=short
TOX_PARALLEL_NO_SPINNER: 1
shell: bash
- if: ${{ matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp' }}
name: Run tests (excluding udf and doctest tests)
run: python -m tox -e "py${PYTHON_VERSION/\./}-notudfdoctest"
env:
PYTHON_VERSION: ${{ matrix.python-version }}
cloud_provider: ${{ matrix.cloud-provider }}
PYTEST_ADDOPTS: --color=yes --tb=short
TOX_PARALLEL_NO_SPINNER: 1
SNOWFLAKE_IS_PYTHON_RUNTIME_TEST: 1
shell: bash
- name: Combine coverages
run: python -m tox -e coverage --skip-missing-interpreters false
shell: bash
Expand Down Expand Up @@ -222,7 +211,7 @@ jobs:
run: python -m pip install -U setuptools pip wheel
- name: Install tox
run: python -m pip install tox
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') && contains('macos', matrix.os.download_name) }}
- if: ${{ contains('macos', matrix.os.download_name) }}
name: Run doctests
run: python -m tox -e "py${PYTHON_VERSION}-doctest-notudf-ci"
env:
Expand All @@ -231,25 +220,14 @@ jobs:
PYTEST_ADDOPTS: --color=yes --tb=short --disable_sql_simplifier
TOX_PARALLEL_NO_SPINNER: 1
shell: bash
- if: ${{ !(matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp') }}
name: Run tests (excluding doctests)
- name: Run tests (excluding doctests)
run: python -m tox -e "py${PYTHON_VERSION/\./}-notdoctest-ci"
env:
PYTHON_VERSION: ${{ matrix.python-version }}
cloud_provider: ${{ matrix.cloud-provider }}
PYTEST_ADDOPTS: --color=yes --tb=short --disable_sql_simplifier
TOX_PARALLEL_NO_SPINNER: 1
shell: bash
- if: ${{ matrix.python-version == '3.11' && matrix.cloud-provider == 'gcp' }}
name: Run tests (excluding udf and doctest tests)
run: python -m tox -e "py${PYTHON_VERSION/\./}-notudfdoctest"
env:
PYTHON_VERSION: ${{ matrix.python-version }}
cloud_provider: ${{ matrix.cloud-provider }}
PYTEST_ADDOPTS: --color=yes --tb=short --disable_sql_simplifier
TOX_PARALLEL_NO_SPINNER: 1
SNOWFLAKE_IS_PYTHON_RUNTIME_TEST: 1
shell: bash
- name: Combine coverages
run: python -m tox -e coverage --skip-missing-interpreters false
shell: bash
Expand Down
34 changes: 5 additions & 29 deletions tests/integ/test_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,37 +762,13 @@ def test_add_requirements_with_empty_stage_as_cache_path(

udf_name = Utils.random_name_for_temp_object(TempObjectType.FUNCTION)

try:

@udf(name=udf_name, packages=["snowflake-snowpark-python==1.8.0"])
def get_numpy_pandas_version() -> str:
import snowflake.snowpark as snowpark

return f"{snowpark.__version__}"

Utils.check_answer(session.sql(f"select {udf_name}()"), [Row("1.8.0")])
except RuntimeError as e:
# this is to temporarily bypass the issue that snowflake-snowpark-python==1.8.0 is not available on gcp
# for gcp, python == 3.11, we skip the test
# for gcp, python < 3.11, we use older snowpark-python lib
assert (
"Unable to auto-upload packages: ['snowflake-snowpark-python==1.8.0']"
in str(e)
)
system_version = f"{sys.version_info[0]}.{sys.version_info[1]}"
if system_version == "3.11":
pytest.xfail(
"SNOW-938998: package snowflake-snowpark-python 1.8.0 is not available on gcp yet"
)
else:

@udf(name=udf_name, packages=["snowflake-snowpark-python==1.3.0"])
def get_numpy_pandas_version() -> str:
import snowflake.snowpark as snowpark
@udf(name=udf_name, packages=["snowflake-snowpark-python==1.8.0"])
def get_numpy_pandas_version() -> str:
import snowflake.snowpark as snowpark

return f"{snowpark.__version__}"
return f"{snowpark.__version__}"

Utils.check_answer(session.sql(f"select {udf_name}()"), [Row("1.3.0")])
Utils.check_answer(session.sql(f"select {udf_name}()"), [Row("1.8.0")])


@pytest.mark.udf
Expand Down
Loading