Skip to content

[python] Add replace_tag support to TagManager and FileStoreTable#7904

Merged
JingsongLi merged 1 commit into
apache:masterfrom
JunRuiLee:pypaimon-replace-tag
May 20, 2026
Merged

[python] Add replace_tag support to TagManager and FileStoreTable#7904
JingsongLi merged 1 commit into
apache:masterfrom
JunRuiLee:pypaimon-replace-tag

Conversation

@JunRuiLee
Copy link
Copy Markdown
Contributor

Purpose

Java supports replacing an existing tag with a new snapshot via Table.replaceTag() and Spark's ReplaceTagProcedure. pypaimon currently lacks this capability.
Users who want to update a tag (e.g. periodically refreshing a latest-prod tag to point to the newest snapshot) must delete and re-create it, leaving a window where the tag does not exist. replace_tag provides atomic replacement semantics.

Tests

  • Replace an existing tag to a specified snapshot_id
  • Replace with snapshot_id=None uses the latest snapshot
  • Replacing a non-existent tag raises ValueError
  • Replacing with a non-existent snapshot_id raises ValueError

Allow replacing an existing tag with a new snapshot, aligning with
Java Table.replaceTag() behavior. The tag must already exist; the
snapshot can be specified by ID or defaults to the latest.
@JunRuiLee JunRuiLee force-pushed the pypaimon-replace-tag branch from eb4dd7d to efc6056 Compare May 20, 2026 07:49
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 764875f into apache:master May 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants