File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -353,10 +353,25 @@ def presets_route(self):
353353
354354 # Helper function to filter out fields not in the insert,
355355 # as well as apply the fields_map
356- def filterPreset (preset : dict ):
357- return {
358- (self .input_lookup [k ] if k in self .input_lookup else k ): v
356+ def filter_preset (preset : dict ):
357+ # Any key that follows the schema.table.attribute format,
358+ # and its schema.table is not in the forms is filtered out.
359+
360+ preset_with_tables_filtered = {
361+ k : v
359362 for k , v in preset .items ()
363+ if (
364+ len (k .split ("." )) == 1
365+ or "." .join (k .split ("." )[0 :2 ]) in self .component_config ["tables" ]
366+ )
367+ }
368+ return {
369+ (
370+ self .input_lookup [k .split ("." ).pop ()]
371+ if k .split ("." ).pop () in self .input_lookup
372+ else k .split ("." ).pop ()
373+ ): v
374+ for k , v in preset_with_tables_filtered .items ()
360375 }
361376
362377 if "presets" not in self .component_config :
@@ -367,7 +382,7 @@ def filterPreset(preset: dict):
367382 )
368383
369384 filtered_preset_dictionary = {
370- k : filterPreset (v ) for k , v in self .presets_dict .items ()
385+ k : filter_preset (v ) for k , v in self .presets_dict .items ()
371386 }
372387
373388 return (
You can’t perform that action at this time.
0 commit comments