-
Notifications
You must be signed in to change notification settings - Fork 16
Fix pickle #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Fix pickle #428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances session management by adding support for an alternative serialization library (dill) and by handling multiple file extensions for session files.
- Introduces dill as a fallback when cloudpickle fails during serialization.
- Adds support for two file extensions (cpkl and dpkl) in both saving and loading sessions.
Comments suppressed due to low confidence (2)
alphastats/gui/utils/session_manager.py:36
- [nitpick] Consider using more descriptive constant names (e.g., CLOUDPICKLE_EXT and DILL_EXT) to improve code readability.
_EXT_C = "cpkl"
alphastats/gui/utils/session_manager.py:125
- If the file suffix is not '.cpkl' or '.dpkl', the code does not initialize 'loaded_data', which may lead to an undefined variable error. Consider adding an else block to handle unexpected file extensions.
if file_path.exists():
Still raises with a chat session: File "/Users/schessner/anaconda3/envs/alphastats_dev/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling |
I think we need to skip the LLMIntegration object and instead only save the serializable attributes of it. |
This pull request enhances the session management functionality in
alphastats
by introducing support for an additional serialization library (dill
) alongside the existingcloudpickle
. It also updates the session saving and loading mechanisms to handle multiple file extensions and improve compatibility.Serialization Enhancements:
dill
as an alternative serialization library to handle cases wherecloudpickle
fails. (alphastats/gui/utils/session_manager.py
) [1] [2]dpkl
) for files serialized withdill
, alongside the existingcpkl
forcloudpickle
. (alphastats/gui/utils/session_manager.py
) [1] [2]Session Management Updates:
get_saved_sessions
to support bothcpkl
anddpkl
file extensions when retrieving saved session files. (alphastats/gui/utils/session_manager.py
)save
method to attempt serialization withcloudpickle
first, falling back todill
if an exception occurs. (alphastats/gui/utils/session_manager.py
)load
method to correctly identify and deserialize files based on their extensions (cpkl
ordpkl
). (alphastats/gui/utils/session_manager.py
)