File tree Expand file tree Collapse file tree
src/dwh2looker/lookml_generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,8 +238,16 @@ def process_views(
238238 for field in current_level_struct_fields :
239239 fields_to_process_for_view .append (field )
240240 if field .is_struct_field :
241- sub_fields = self .sort_fields (fields_in_schema [field ].keys ())
242- fields_to_process_for_view .extend (sub_fields ) # Add immediate children
241+ structs_to_process = [field ]
242+ while structs_to_process :
243+ current_struct = structs_to_process .pop (0 )
244+ sub_schema = fields_in_schema .get (current_struct , {})
245+ sub_fields = self .sort_fields (sub_schema .keys ())
246+ for sub_field in sub_fields :
247+ fields_to_process_for_view .append (sub_field )
248+ fields_in_schema [sub_field ] = sub_schema [sub_field ]
249+ if sub_field .is_struct_field :
250+ structs_to_process .append (sub_field )
243251
244252 processed_fields = []
245253 for field in fields_to_process_for_view :
You can’t perform that action at this time.
0 commit comments