Skip to content
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

[REF-2045] Implement __reduce_ex__ for MutableProxy #2688

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Feb 21, 2024

Pass through __reduce_ex__ onto the wrapped instance to strip it off when cloudpickling to redis.

test_state: augment modify_state test for writing MutableProxy

If the object contains a MutableProxy inside of it, then we should not get a pickling error.

Fix #2687

Also fix Base.get_value to actually accept a str key like the signature suggests... retain the existing weird behavior of passing key as whatever you like for backward compatibility.

If the object contains a MutableProxy inside of it, then we get a pickling
error.
Pass through `__reduce_ex__` onto the wrapped instance to strip it off when
cloudpickling to redis.
Unless the key isn't a field on the model, then it falls back to the previous
behavior of just returning the given key as is... why does it do this? I don't
know.
@martinxu9 martinxu9 self-requested a review February 21, 2024 23:52
@masenf masenf merged commit 9534957 into main Feb 22, 2024
45 checks passed
@picklelo picklelo deleted the masenf/mutable-proxy-reduce-ex branch February 22, 2024 22:56
Yummy-Yums pushed a commit to Yummy-Yums/reflex-codebase that referenced this pull request Feb 28, 2024
* test_state: augment modify_state test for writing MutableProxy

If the object contains a MutableProxy inside of it, then we get a pickling
error.

* Implement __reduce_ex__ for MutableProxy

Pass through `__reduce_ex__` onto the wrapped instance to strip it off when
cloudpickling to redis.

* base: get_value actually works with a str key

Unless the key isn't a field on the model, then it falls back to the previous
behavior of just returning the given key as is... why does it do this? I don't
know.
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.

[REF-2045] NotImplementedError: object proxy must define __reduce_ex__()
2 participants