feat(backup): expose incremental_base_backup_id on BackupListReturn (#2069) - #2116
Open
Anai-Guo wants to merge 1 commit into
Open
feat(backup): expose incremental_base_backup_id on BackupListReturn (#2069)#2116Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
GET /backups/{backend} returns incremental_base_backup_id per item (see
BackupListResponseItems0 and Scheduler.List in weaviate/weaviate), but
BackupListReturn does not declare the field, so list_backups() silently
drops it and callers cannot tell which base backup an incremental backup
was built on without a separate get_create_status() call per backup.
Add the field as Optional[str] defaulting to None: the server omits it for
non-incremental backups and only populates it for callers it has confirmed
as root, so its absence must stay non-fatal.
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
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.
Closes #2069.
Problem
Weaviate's
GET /backups/{backend}returnsincremental_base_backup_idon every item —BackupListResponseItems0declares it, andScheduler.Listpopulates it for callers the handler has confirmed as root.BackupListReturndoesn't declare the field, soexecutor.list_backups()(BackupListReturn(**entry)) silently drops it. There is currently no way to tell fromclient.backup.list_backups(...)which base backup an incremental backup was built on — the only alternative is aget_create_status()round trip per backup.Change
One field on
BackupListReturn:The JSON key is snake_case server-side (
json:"incremental_base_backup_id,omitempty"), so it matches the field name and needs no alias.Optional[str]withdefault=Noneis deliberate rather than a required field: the server omits the key for non-incremental backups, and also for any caller it has not confirmed as root, so its absence must stay non-fatal.Nothing else changes — no alias on an existing field is touched, and no other model is affected.
Verification
test/test_backup.py(new, no server or network needed):Noneboth when the key is omitted and when it is explicitlynullRun against the real package with only
weaviate/backup/backup.pyswapped:Also confirmed
BackupListReturn(**entry)still parses an entry that has noincremental_base_backup_idkey — the pre-existing behaviour is unchanged.Lint, at the versions pinned in
.pre-commit-config.yaml/main.yaml, over both changed files:test/is outside the pyright matrix (weaviate,integration,integration_embedded) and is covered by the unit-tests job.Note
I left
docs/changelog.rstalone since it only carries released versions and noUnreleasedsection — happy to add an entry under whichever version you're cutting if you'd prefer it in this PR.🤖 Generated with Claude Code