Feature/pickle support#3853
Closed
pkusnail wants to merge 6 commits into
Closed
Conversation
- Add __getstate__ and __setstate__ methods to ConsoleThreadLocals class - Add __getstate__ and __setstate__ methods to Console class - Enable serialization for caching frameworks like Redis - Maintains backward compatibility and thread safety - Fixes 'cannot pickle ConsoleThreadLocals object' error
- Add test_pickle_support.py with 5 comprehensive test cases - Test ConsoleThreadLocals and Console pickle functionality - Test cache simulation scenario (Langflow compatibility) - Test complex state preservation and nested objects - All tests pass and verify proper serialization/deserialization
- Add test_pickle_fix.py for manual testing and validation - Tests basic functionality, Langflow compatibility, and thread-local behavior - Provides detailed output for debugging and verification - Can be run independently for quick validation
- Add entry under [Unreleased] section for pickle support feature - Reference PR Textualize#3853 for ConsoleThreadLocals and Console serialization - Follows Keep a Changelog format
- Add Tony Seah (pkusnail) to contributors list for pickle support contribution - Alphabetically placed for proper organization
- Format rich/console.py with black for consistency - Format tests/test_pickle_support.py and test_pickle_fix.py - Ensures code style compliance with Rich project standards
Member
|
Pickling Console objects doesn't make a great deal of sense. This feels like a workaround that likely has a better solution. I would need confirmation from the Langflow devs before I merge this one. |
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.
Type of changes
Checklist
Description
Please describe your changes here. If this fixes a bug, please link to the issue, if possible.
This feature is essential for this PR langflow-ai/langflow#9982