Add Google Sheets state persister - #932
Open
prvn0x wants to merge 1 commit into
Open
Conversation
Closes apache#213 Co-authored-by: goutamk09 <goutamk09@users.noreply.github.com>
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 #213
Adds a state persister backed by a Google Sheets worksheet, so applications can
persist and reload state in a store that is human-readable and shareable without
running a database. This builds on the earlier work in #670 by @goutamk09 and
addresses the review feedback left there.
Changes
burr/integrations/persisters/b_google_sheets.py—GoogleSheetsBasePersister,implementing
BaseStatePersister. State is stored one row per step, keyed by(partition_key, app_id, sequence_id, position), with a header row written by anidempotent
initialize().pyproject.toml— agoogle-sheetsextra sogspreadstays an optionaldependency, wired into the
testsextra.docs/reference/persister.rst— table entry andautoclassreference.tests/integrations/persisters/test_b_google_sheets.py— 16 unit tests.Specific points raised in the review of #670:
load()scans to the last matching row rather than the first, so state isstill readable after repeated saves to the same app.
_data_rows()helper, so the header row is skippedconsistently rather than in some methods but not others.
save()andload()match theBaseStatePersistersignatures, includingsequence_id.Checklist