Skip to content

SNOW-3375255: enable Python 3.14 UDF tests#4172

Merged
sfc-gh-bkogan merged 36 commits into
mainfrom
bkogan-enable-314-tests
Apr 27, 2026
Merged

SNOW-3375255: enable Python 3.14 UDF tests#4172
sfc-gh-bkogan merged 36 commits into
mainfrom
bkogan-enable-314-tests

Conversation

@sfc-gh-bkogan

@sfc-gh-bkogan sfc-gh-bkogan commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator
  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-3375255

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

    UDF tests were disabled due to not having an available build in PyPI. Now we do.

Dynamic dbapi package resolution

Replaced the single UDTF_PACKAGE_MAP with two maps and a resolver:

  • _ANACONDA_UDTF_PACKAGE_MAP — the original list (uses psycopg2, msodbcsql, databricks-sql-connector).
  • _PYPI_UDTF_PACKAGE_MAP — a PyPI-compatible subset. Postgres uses psycopg2-binary. SQL Server and Databricks are intentionally omitted.
  • resolve_udtf_packages(dbms_type, artifact_repository) picks the right list. On PyPI for SQL Server / Databricks it raises SnowparkClientException with a clear message telling the user to switch to Anaconda.
    In BaseDriver.udtf_ingestion we now call session._get_default_artifact_repository() to get the session's effective default (which also honours account/database/schema overrides via SYSTEM$GET_DEFAULT_PYTHON_ARTIFACT_REPOSITORY) and resolve the package list accordingly. Result: a 3.14 user automatically gets the PyPI-friendly list, and a <3.14 user who has manually switched to PyPI also gets a working list (or a clear error for SQL Server/Databricks).

Tests skipped on Python 3.14

  • test_sql_server.py — all UDTF-path variants (directly or via pytest.param(..., marks=...) for parametrized mixes). msodbcsql is not on PyPI at all. The non-UDTF (client-side) variants still run.
  • test_databricks.pytest_udtf_ingestion_databricks and test_session_init_udtf (the two tests that exercise the UDTF install path). thrift is sdist-only on PyPI and the Anaconda channel lacks a 3.14 build of databricks-sql-connector.

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sfc-gh-bkogan

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

@sfc-gh-bkogan sfc-gh-bkogan added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Apr 14, 2026
@sfc-gh-bkogan sfc-gh-bkogan force-pushed the bkogan-enable-314-tests branch from 2250060 to 50937a2 Compare April 14, 2026 20:08
Comment thread src/conftest.py
Comment thread src/snowflake/snowpark/_internal/udf_utils.py
Comment thread tests/integ/test_stored_procedure.py
@codecov-commenter

codecov-commenter commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.41%. Comparing base (e7c3d2e) to head (7d45568).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4172      +/-   ##
==========================================
+ Coverage   95.16%   95.41%   +0.25%     
==========================================
  Files         171      171              
  Lines       43788    43801      +13     
  Branches     7503     7505       +2     
==========================================
+ Hits        41672    41794     +122     
+ Misses       1294     1227      -67     
+ Partials      822      780      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The PyPI gaps in UDTF package resolution (SQL Server, Databricks) are
independent of the Python version - they apply to any session whose
default artifact repository is PyPI, not just Python 3.14+. Update the
comment and the SnowparkClientException message to reflect that, and
note that on Python <3.14 a PyPI default can still occur via an
account/database/schema-level override.
@sfc-gh-bkogan sfc-gh-bkogan marked this pull request as ready for review April 23, 2026 22:04
@sfc-gh-bkogan sfc-gh-bkogan requested review from a team as code owners April 23, 2026 22:04

@sfc-gh-yuwang sfc-gh-yuwang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data source part LGTM

@sfc-gh-aling sfc-gh-aling left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sfc-gh-bkogan sfc-gh-bkogan merged commit 7601197 into main Apr 27, 2026
27 of 37 checks passed
@sfc-gh-bkogan sfc-gh-bkogan deleted the bkogan-enable-314-tests branch April 27, 2026 18:00
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md snowpark-pandas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants