diff --git a/image_prediction/formatter/formatters/camel_case.py b/image_prediction/formatter/formatters/camel_case.py index 228baa4..bb6cd9d 100644 --- a/image_prediction/formatter/formatters/camel_case.py +++ b/image_prediction/formatter/formatters/camel_case.py @@ -19,7 +19,8 @@ class Snake2CamelCaseKeyFormatter(Formatter): # If we wanted to do this properly, we would need handlers for all expected types and dispatch based # on a type comparison. This is too much engineering for the limited use-case of this class though. if isinstance(data, Iterable) and not isinstance(data, dict) and not isinstance(data, str): - return type(data)(map(self.__format, data)) + f = map(self.__format, data) + return type(data)(f) if not isinstance(data, map) else f if not isinstance(data, dict): return data