@@ -553,18 +553,18 @@ def convert_to_nested_schema(flat_schemas: dict[str, str]) -> dict[str, Any]:
553553 current_level = nested_schema
554554
555555 for part in parts [:- 1 ]:
556- current_level = current_level .setdefault (part , {}).setdefault ("properties" , {})
556+ current_level = current_level .setdefault (part , {}).setdefault ("properties" , {}) # type: ignore[reportUnknownVariableType]
557557
558558 current_level [parts [- 1 ]] = {"type" : value }
559559
560- return nested_schema
560+ return nested_schema # type: ignore[reportUnknownVariableType]
561561
562562
563563def combine_dicts (dest : dict [Any , Any ], src : dict [Any , Any ]) -> None :
564564 """Combine two dictionaries recursively."""
565565 for k , v in src .items ():
566566 if k in dest and isinstance (dest [k ], dict ) and isinstance (v , dict ):
567- combine_dicts (dest [k ], v )
567+ combine_dicts (dest [k ], v ) # type: ignore[reportUnknownVariableType]
568568 else :
569569 dest [k ] = v
570570
@@ -585,12 +585,12 @@ def flat_schema_to_index_mapping(flat_schema: dict[str, str]) -> dict[str, Any]:
585585 current_level = result
586586
587587 for part in parts [:- 1 ]:
588- node = current_level .setdefault (part , {})
588+ node = current_level .setdefault (part , {}) # type: ignore[reportUnknownVariableType]
589589
590590 if "type" in node and node ["type" ] not in ("nested" , "object" ):
591- current_level = node .setdefault ("fields" , {})
591+ current_level = node .setdefault ("fields" , {}) # type: ignore[reportUnknownVariableType]
592592 else :
593- current_level = node .setdefault ("properties" , {})
593+ current_level = node .setdefault ("properties" , {}) # type: ignore[reportUnknownVariableType]
594594
595595 leaf_key = parts [- 1 ]
596596 current_level [leaf_key ] = {"type" : field_type }
@@ -604,16 +604,16 @@ def flat_schema_to_index_mapping(flat_schema: dict[str, str]) -> dict[str, Any]:
604604 if field_type == "alias" :
605605 current_level [leaf_key ]["path" ] = "@timestamp"
606606
607- return result
607+ return result # type: ignore[reportUnknownVariableType]
608608
609609
610610def get_column_from_index_mapping_schema (keys : list [str ], current_schema : dict [str , Any ] | None ) -> str | None :
611611 """Recursively traverse the schema to find the type of the column."""
612612 key = keys [0 ]
613613 if not current_schema :
614614 return None
615- column = current_schema .get (key ) or {}
616- column_type = column .get ("type" ) if column else None
615+ column = current_schema .get (key ) or {} # type: ignore[reportUnknownVariableType]
616+ column_type = column .get ("type" ) if column else None # type: ignore[reportUnknownVariableType]
617617 if not column_type and len (keys ) > 1 :
618- return get_column_from_index_mapping_schema (keys [1 :], current_schema = column .get ("properties" ))
619- return column_type
618+ return get_column_from_index_mapping_schema (keys [1 :], current_schema = column .get ("properties" )) # type: ignore[reportUnknownVariableType]
619+ return column_type # type: ignore[reportUnknownVariableType]
0 commit comments