@@ -150,7 +150,7 @@ def parse_schema_dict(self, parent_path, schema_dict, parent_id_fields=None, tit
150
150
if title :
151
151
title_lookup [title ].property_name = property_name + '/0'
152
152
153
- sub_sheet_name = ('_' .join (x [:3 ] for x in parent_path .split ('/' )) + property_name )[:31 ]
153
+ sub_sheet_name = ('_' .join (x [:3 ] for x in parent_path .split ('/' ) if x != '0' ) + property_name )[:31 ]
154
154
155
155
#self.sub_sheet_mapping[parent_name+'/'+property_name] = sub_sheet_name
156
156
@@ -162,7 +162,7 @@ def parse_schema_dict(self, parent_path, schema_dict, parent_id_fields=None, tit
162
162
for field in id_fields :
163
163
sub_sheet .add_field (field , id_field = True )
164
164
fields = self .parse_schema_dict (
165
- parent_path + property_name ,
165
+ parent_path + property_name + '/0' ,
166
166
property_schema_dict ['items' ],
167
167
parent_id_fields = id_fields ,
168
168
title_lookup = title_lookup .get (title ))
@@ -171,14 +171,16 @@ def parse_schema_dict(self, parent_path, schema_dict, parent_id_fields=None, tit
171
171
172
172
for field , child_title in fields :
173
173
if self .use_titles :
174
- if not child_title or not title :
174
+ if not child_title :
175
175
warn ('Field {} does not have a title, skipping.' .format (field ))
176
+ elif not title :
177
+ warn ('Field {} does not have a title, skipping it and all its children.' .format (property_name ))
176
178
else :
177
179
# This code only works for arrays that are at 0 or 1 layer of nesting
178
- assert len (parent_path .split ('/' )) <= 2
180
+ assert len (parent_path .replace ( '/0/' , '/' ). split ('/' )) <= 2
179
181
sub_sheet .add_field (title + ':' + child_title )
180
182
else :
181
- sub_sheet .add_field (parent_path + property_name + '/' + field )
183
+ sub_sheet .add_field (parent_path + property_name + '/0/ ' + field )
182
184
if self .rollup and 'rollUp' in property_schema_dict and field in property_schema_dict ['rollUp' ]:
183
185
rolledUp .add (field )
184
186
yield property_name + '/0/' + field , (title + ':' + child_title if title and child_title else None )
0 commit comments