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):
29
29
30
30
for key , val in data_to_restructure .items ():
31
31
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 ] = {}
34
38
35
39
elif isinstance (val .get ('arrayValue' ), dict ):
36
40
arr = []
@@ -81,7 +85,7 @@ def _decode_datastore(value):
81
85
elif value .get ('doubleValue' ):
82
86
return float (value ['doubleValue' ])
83
87
84
- elif value .get ('stringValue' ):
88
+ elif isinstance ( value .get ('stringValue' ), str ):
85
89
return str (value ['stringValue' ])
86
90
87
91
elif value .get ('mapValue' ):
You can’t perform that action at this time.
0 commit comments