-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Sets not serialized by fields.List #175
Sets not serialized by fields.List #175
Conversation
@@ -59,7 +59,7 @@ def to_marshallable_type(obj): | |||
if obj is None: | |||
return None # make it idempotent for None | |||
|
|||
if hasattr(obj, '__getitem__'): | |||
if hasattr(obj, '__iter__'): |
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.
I don't think this change is needed. This code is used in FormattedString and Url to ensure we have a mapping that can be used with kwargs to format the string/url, and should specifically check that the object passed has dict-like behavior. Your set test passes without it.
Aside from the issue with to_marshallable_type this looks good to me. Let me know if there's something I'm missing in that specific part. If not, I'll merge this minus that line. Thanks for the PR! |
@skimbrel : you're right. I changed it thinking it was the expected behaviour but I was wrong. I reverted my change. Thanks for the review ! :) |
Thanks for the update! Merging. |
Sets not serialized by fields.List
The
List
field can't serialize aset()
. I think it should.Here is a unit test providing the proof, and an attempt to fix this issue.