Skip to content

Fix python-arango Client (de)serialization #264

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

Merged
merged 1 commit into from
Aug 1, 2023
Merged

Conversation

geenen124
Copy link
Contributor

This PR allows a python-arango ArangoClient to be serialized and deserialized correctly using pickle. This is needed for usage in multi-process environments.

To solve this, two named functions replace the lambda functions for JSON serialization and deserialization in the client constructor, and the DefaultHTTPAdapter now correctly overrides its __attrs__ variable, including the latest timeout variables to support correct __getstate__ and __setstate__ calls.

@codecov-commenter
Copy link

Codecov Report

Merging #264 (bb2ccce) into main (8b09e07) will increase coverage by 0.42%.
Report is 10 commits behind head on main.
The diff coverage is 96.20%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #264      +/-   ##
==========================================
+ Coverage   98.58%   99.01%   +0.42%     
==========================================
  Files          26       26              
  Lines        3899     3958      +59     
==========================================
+ Hits         3844     3919      +75     
+ Misses         55       39      -16     
Files Changed Coverage Δ
arango/client.py 98.41% <87.50%> (-1.59%) ⬇️
arango/collection.py 98.50% <90.00%> (+2.03%) ⬆️
arango/aql.py 95.04% <100.00%> (+0.04%) ⬆️
arango/cursor.py 100.00% <100.00%> (ø)
arango/database.py 99.86% <100.00%> (+<0.01%) ⬆️
arango/http.py 100.00% <100.00%> (ø)

@geenen124 geenen124 merged commit 744a6e9 into main Aug 1, 2023
@geenen124 geenen124 deleted the fix-serialization branch August 1, 2023 14:10
@geenen124 geenen124 restored the fix-serialization branch August 1, 2023 14:10
@geenen124 geenen124 deleted the fix-serialization branch August 1, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants