[python] Implement branch CRUD on FileSystemCatalog#7755
Merged
JingsongLi merged 1 commit intoapache:masterfrom May 3, 2026
Merged
[python] Implement branch CRUD on FileSystemCatalog#7755JingsongLi merged 1 commit intoapache:masterfrom
JingsongLi merged 1 commit intoapache:masterfrom
Conversation
Override the five branch CRUD methods on FileSystemCatalog so that Python users on the local-catalog path get the same behavior as RESTCatalog (added in apache#7747). Each method delegates to FileSystemBranchManager via FileStoreTable.branch_manager() and translates the manager's ValueError messages back into the typed Catalog exception hierarchy (BranchAlreadyExistException, BranchNotExistException, TagNotExistException). Sister PR to apache#7751 (FileSystemCatalog Tag CRUD); follow-up to apache#7747.
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Override the five branch CRUD methods on
FileSystemCatalogso Python users on the local-catalog path get the same typed behavior asRESTCatalog(added in #7747). Sister PR to #7751 (FileSystemCatalog Tag CRUD); follow-up to #7747.FileSystemCatalogpreviously inherited theCatalogABCNotImplementedErrorstubs because the original PR (#7747) did not port the manager-layer wiring. The PythonFileSystemBranchManageralready exists atpypaimon/branch/filesystem_branch_manager.pyand is reachable viaFileStoreTable.branch_manager(), so this PR is a thin wrapper: each catalog method delegates to the manager and translatesValueErrormessages back into the typed catalog exception hierarchy (BranchAlreadyExistException,BranchNotExistException,TagNotExistException).In scope
FileSystemCatalog:create_branch/drop_branch/rename_branch/fast_forward/list_branches.tests/filesystem_catalog_branch_test.pycovering the same matrix asRESTCatalogBranchCRUDTestfrom [python] Add branch CRUD REST implementation to RESTCatalog #7747 (create / list / rename / drop / fast_forward — happy paths plus all typed-exception paths).FilesystemCatalogBranchInheritsNotImplementedTestclass fromrest/rest_branch_test.py(it assertedNotImplementedError, which no longer holds).Out of scope
FileSystemBranchManager"from-tag" path has a pre-existing bug:_copy_with_branchreturns aSnapshotManagerthat doesn't switch to the new branch's path, socopy_file(src, dst)ends up withsrc == dstand raisesSameFileError. That's a manager-level fix. The catalog-layer error translation for the from-tag path is still covered bytest_create_branch_from_nonexistent_tag_raises. Two corresponding happy-path tests (test_create_branch_from_existing_tagandtest_fast_forward_happy) are intentionally omitted with NOTE comments pointing at the bug.ignore_if_existsparameter oncreate_branch— JavaCatalog.createBranchdoes not expose it, and the manager-layer default (False) is sufficient.Tests
Local run from
paimon-python/:Anti-divergence checklist
CatalogABC (identifier: Union[str, Identifier],tag_name=None).RESTCatalog(BranchAlreadyExistException/BranchNotExistException/TagNotExistException/TableNotExistException).list_branchesreturnsList[str](notPagedList), matching the strict Java alignment from [python] Add branch CRUD REST implementation to RESTCatalog #7747.pypaimon/branch/filesystem_branch_manager.pymaster HEAD.Generative AI disclosure
Drafted with assistance from a generative AI tool. All code, tests, and exception-translation logic were reviewed and validated by the contributor.