Skip to content

Commit

Permalink
Thinking unordered things are ordered is bad.
Browse files Browse the repository at this point in the history
  • Loading branch information
repole committed Apr 8, 2021
1 parent 4118894 commit d17bef0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drowsy/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,15 @@ def get_instance(self, data):
the wrong type.
"""
id_data_keys = {self.fields[k].data_key or k for k in self.id_keys}
id_keys = list(self.id_keys)
id_data_keys = [self.fields[k].data_key or k for k in id_keys]
if set(id_data_keys).issubset(data.keys()):
# data includes primary key columns
# attempt to generate filters
try:
filters = {
pair[0]: self.fields[pair[0]].deserialize(data[pair[1]])
for pair in zip(self.id_keys, id_data_keys)
for pair in zip(id_keys, id_data_keys)
}
except ValidationError:
raise self.make_error("invalid_identifier", data=data)
Expand Down

0 comments on commit d17bef0

Please sign in to comment.