Conversation
|
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.



This pull request introduces enhancements to the snapshot management functionality in the Switcher client, focusing on enabling local snapshot persistence and improving usability for local development and automated updates. The main changes include adding the ability to save snapshots to disk, updating the callback mechanism for snapshot updates, and expanding the playground tests to demonstrate these new use cases.
Snapshot Persistence and Management:
save_snapshotfunction insnapshot_loader.pyto persist snapshots to disk at a specified location, supporting local mode and enabling snapshot reuse between runs.check_snapshotmethod inclient.pyto save the snapshot to disk if asnapshot_locationis provided in the context options.Snapshotclass intypes.pywith ato_dictmethod for serializing the snapshot back to its original dictionary format, supporting JSON export.client.pyto include the newsave_snapshotfunction.Callback and Usability Improvements:
schedule_snapshot_auto_updatecallback signature for clarity, and updated the example inREADME.mdto print the snapshot version when updated. [1] [2]Testing and Playground Enhancements:
tests/playground/index.pywith new use cases to demonstrate loading snapshots from remote sources and auto-updating snapshots with local persistence, including configurable environment and snapshot location. [1] [2]Internal Data Handling:
Snapshotclass to store the original data for accurate serialization and export.