@@ -85,22 +85,21 @@ def get_value(output: Union[Mapping, List], path: str, exclude: List = None) ->
8585 paired_key_value = associate_key_of_my_value (jmespath_value_parser (path ), values )
8686
8787 # We need to get a list of reference keys - list of strings.
88- # Based on the expression or output type we might have differen data types
88+ # Based on the expression or output type we might have different data types
8989 # therefore we need to normalize.
9090 if re .search (r"\$.*\$" , path ):
9191 wanted_reference_keys = jmespath .search (jmespath_refkey_parser (path ), output )
9292
93- # if dict()
94- if isinstance (wanted_reference_keys , dict ):
93+ if isinstance (wanted_reference_keys , dict ): # when wanted_reference_keys is dict() type
9594 list_of_reference_keys = keys_cleaner (wanted_reference_keys )
96- # if list(list())
97- elif any (isinstance (element , list ) for element in wanted_reference_keys ):
95+ elif any (
96+ isinstance (element , list ) for element in wanted_reference_keys
97+ ): # when wanted_reference_keys is a nested list
9898 list_of_reference_keys = flatten_list (wanted_reference_keys )[0 ]
99- # if list()
100- elif isinstance (wanted_reference_keys , list ):
99+ elif isinstance (wanted_reference_keys , list ): # when wanted_reference_keys is a list
101100 list_of_reference_keys = wanted_reference_keys
102101 else :
103- raise ValueError ("Reference Key normalization failure. Please verify datat type returned." )
102+ raise ValueError ("Reference Key normalization failure. Please verify data type returned." )
104103
105104 return keys_values_zipper (list_of_reference_keys , paired_key_value )
106105
0 commit comments