File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ def _from_datastore(data):
2929
3030 for key , val in data_to_restructure .items ():
3131
32- if val .get ('mapValue' ):
33- data_to_restructure [key ] = _from_datastore (val ['mapValue' ])
32+ if isinstance (val .get ('mapValue' ), dict ):
33+
34+ if val ['mapValue' ].get ('fields' , False ):
35+ data_to_restructure [key ] = _from_datastore (val ['mapValue' ])
36+ else :
37+ data_to_restructure [key ] = {}
3438
3539 elif isinstance (val .get ('arrayValue' ), dict ):
3640 arr = []
@@ -81,7 +85,7 @@ def _decode_datastore(value):
8185 elif value .get ('doubleValue' ):
8286 return float (value ['doubleValue' ])
8387
84- elif value .get ('stringValue' ):
88+ elif isinstance ( value .get ('stringValue' ), str ):
8589 return str (value ['stringValue' ])
8690
8791 elif value .get ('mapValue' ):
You can’t perform that action at this time.
0 commit comments