Skip to content

Refactor to write APIs to default to main branch #312

Closed
kevinjqliu wants to merge 3 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/write-to-branch
Closed

Refactor to write APIs to default to main branch #312
kevinjqliu wants to merge 3 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/write-to-branch

Conversation

@kevinjqliu
Copy link
Copy Markdown
Contributor

@kevinjqliu kevinjqliu commented Jan 27, 2024

Issue #306 (Support writing to a branch)

First pass.
This PR

  • Update string literals ("main"/"branch"/"tag") to its corresponding constant. String literals in tests are left alone.
  • Default append and overwrite API to the "main" branch and pass the variable all the way down

self._snapshot_id = table.new_snapshot_id()
# Since we only support the main branch for now
self._branch = branch
self._parent_snapshot_id = snapshot.snapshot_id if (snapshot := self._table.current_snapshot()) else None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is more involved than just setting the name of the branch. There we take the parent snapshot that's by default the parent of the current snapshot. The current snapshot is the HEAD of the main branch. Before adding this, I would love to see also some integration tests with Spark, and some tests that assert the snapshot-tree.

Copy link
Copy Markdown
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

I love the changes, but before exposing this to the public through an API, we need to make sure that the behavior is correct.

@kevinjqliu kevinjqliu marked this pull request as draft January 27, 2024 19:50
@kevinjqliu kevinjqliu closed this Jan 19, 2025
@kevinjqliu kevinjqliu deleted the kevinjqliu/write-to-branch branch January 19, 2025 20:14
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