-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix ListParameter Hashability #2227
Conversation
@Tarrasch @j-ostrich Could y'all review? Thanks! |
I think the same changes should be made for |
Should I subclass |
I don't see the benefit of subclassing besides saving a couple of lines of code, but I'm also not against it. LGTM, but I don't have write access so you'll have to wait for @Tarrasch to take a look. |
@joemeszaros I see you added |
I'll merge this tomorrow (2017-09-12) unless I hear otherwise. |
@dlstadther Sorry for the late response, but I was on holiday and got back just now. |
@joemeszaros No worries. Feel free to still review (although merged). If you have problems or suggestions, i'm happy to submit another PR with those changes. |
Description
With the merge of #2115,
ListParameter
normalization uses the_recursively_freeze()
method to transform lists of dictionaries into tuples of_FrozenOrderedDict
. However,ListParameter
'sparse()
andserialize()
methods were not updated to utilize the_DictParamEncoder
, allowing JSON serialization.This PR resolves the serialization of lists of dictionaries provided to
ListParameter
.Motivation and Context
Fixes unhashability of
ListParameter
when provided a list of dictionaries caused by #2115.Have you tested this? If so, how?
Added hashability test for list of dictionaries.