Skip to content

feat: Iceberg WAP branch read via BRANCH time travel#4267

Merged
sfc-gh-igarish merged 3 commits into
mainfrom
igarish/iceberg-version-ref-branch-read
Jul 10, 2026
Merged

feat: Iceberg WAP branch read via BRANCH time travel#4267
sfc-gh-igarish merged 3 commits into
mainfrom
igarish/iceberg-version-ref-branch-read

Conversation

@sfc-gh-igarish

@sfc-gh-igarish sfc-gh-igarish commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds version_ref and branch to TimeTravelConfig for Iceberg WAP branch reads
  • Maps Spark Iceberg branch, tag, and version_ref reader options
  • Emits Snowflake AT(VERSION_REF => '<name>') for tag/branch named-ref reads (unifies prior VERSION_TAG SQL)
  • Builds on merged tag support (SNOW-3473261: Add Iceberg tag time travel via version_tag #4211)

Test plan

  • Unit tests for TimeTravelConfig and _extract_time_travel_from_options
  • Manual: branch read on managed Iceberg table with WAP branch
  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-3674169

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • 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 change solves the related issue.

    Extends TimeTravelConfig with version_ref and branch, maps Spark Iceberg reader options (branch, tag, version_ref, existing tag aliases), and emits Snowflake AT (VERSION_REF => '<name>') for named-ref reads. Tag reads keep the same customer-facing behavior while using the unified VERSION_REF SQL form.

@codecov-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (781994f) to head (05723d1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4267   +/-   ##
=======================================
  Coverage   95.44%   95.45%           
=======================================
  Files         171      171           
  Lines       44463    44501   +38     
  Branches     7606     7614    +8     
=======================================
+ Hits        42438    42478   +40     
+ Misses       1254     1253    -1     
+ Partials      771      770    -1     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread src/snowflake/snowpark/_internal/utils.py
@sfc-gh-aling

sfc-gh-aling commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

there are some failing tests, please fix them and also improve the test coverage. thanks!

@sfc-gh-yuwang

Copy link
Copy Markdown
Collaborator

Looks like this is changing a public class, should we add changelog for it?

@sfc-gh-igarish

Copy link
Copy Markdown
Collaborator Author

Thanks — working on this. Current failures look tied to missing CHANGELOG / AST / thread-safety checklist items plus unit-test gaps around the new version_ref / branch fields and the VERSION_TAGVERSION_REF SQL change. Next push will add the changelog entry, extend unit coverage for the new paths, and fix the failing checks.

@sfc-gh-igarish

Copy link
Copy Markdown
Collaborator Author

Yes — TimeTravelConfig gains public version_ref and branch parameters, so I will add a CHANGELOG entry documenting Iceberg WAP branch / named-ref time travel via VERSION_REF.

@sfc-gh-igarish sfc-gh-igarish force-pushed the igarish/iceberg-version-ref-branch-read branch from 688463b to b5cd211 Compare July 1, 2026 20:29
@sfc-gh-igarish

Copy link
Copy Markdown
Collaborator Author

Addressed in b5cd211 — added CHANGELOG entry, fixed/extended unit tests (VERSION_REF message alignment + version_ref/branch validation coverage), and updated the PR description with the thread-safety / AST checklist items.

@sfc-gh-igarish

Copy link
Copy Markdown
Collaborator Author

Added CHANGELOG entry under 1.53.0 New Features in b5cd211.

@sfc-gh-igarish sfc-gh-igarish force-pushed the igarish/iceberg-version-ref-branch-read branch from b5cd211 to 263b01d Compare July 2, 2026 05:58
@sfc-gh-igarish

Copy link
Copy Markdown
Collaborator Author

Removed the CHANGELOG entry in 263b01d — same rationale as #4262: the version_ref / branch time-travel surface is wired through Snowpark Connect (SAS) only, not as a standalone public Snowpark Python API, so it should not appear in the release notes. Branch is rebased onto latest main.

@sfc-gh-rwincey sfc-gh-rwincey force-pushed the igarish/iceberg-version-ref-branch-read branch from 3a8c156 to 263b01d Compare July 7, 2026 19:18
sfc-gh-igarish and others added 3 commits July 7, 2026 13:04
Extend TimeTravelConfig with version_ref and branch parameters, map Spark
Iceberg branch/tag reader options, and emit Snowflake AT(VERSION_REF => ...)
for named-ref reads. Tags continue to work through version_tag but now use
the unified VERSION_REF SQL form.
Add CHANGELOG entry, align unit tests with unified VERSION_REF SQL and
validation messages, and extend coverage for version_ref/branch validation.

Co-authored-by: Cursor <[email protected]>
This surface is consumed only from Snowpark Connect (SAS), not as a
standalone public Snowpark Python feature, so it should not appear in
the release notes.

Co-authored-by: Cursor <[email protected]>
@sfc-gh-igarish sfc-gh-igarish force-pushed the igarish/iceberg-version-ref-branch-read branch from 263b01d to 05723d1 Compare July 7, 2026 20:06
@sfc-gh-rwincey sfc-gh-rwincey force-pushed the igarish/iceberg-version-ref-branch-read branch from f3034ea to 05723d1 Compare July 7, 2026 21:36
@sfc-gh-igarish sfc-gh-igarish changed the title feat: Iceberg WAP branch read via VERSION_REF time travel feat: Iceberg WAP branch read via BRANCH time travel Jul 10, 2026
@sfc-gh-igarish sfc-gh-igarish merged commit 9a6ac71 into main Jul 10, 2026
57 of 61 checks passed
@sfc-gh-igarish sfc-gh-igarish deleted the igarish/iceberg-version-ref-branch-read branch July 10, 2026 01:45
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants