Skip to content

Refactor to write APIs to default to main branch #312

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

Closed
wants to merge 3 commits into from

Conversation

kevinjqliu
Copy link
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._operation = operation
self._table = table
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
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
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