diff --git a/metadata-ingestion/src/datahub/utilities/memory_footprint.py b/metadata-ingestion/src/datahub/utilities/memory_footprint.py index fc7d61ecdcfad..f5f5fdf54ff9b 100644 --- a/metadata-ingestion/src/datahub/utilities/memory_footprint.py +++ b/metadata-ingestion/src/datahub/utilities/memory_footprint.py @@ -1,7 +1,7 @@ from collections import deque from itertools import chain from sys import getsizeof -from typing import Any +from typing import Any, Iterator def total_size(o: Any, handlers: Any = {}) -> int: @@ -15,7 +15,7 @@ def total_size(o: Any, handlers: Any = {}) -> int: Based on https://github.com/ActiveState/recipe-577504-compute-mem-footprint/blob/master/recipe.py """ - def dict_handler(d: dict) -> chain[Any]: + def dict_handler(d: dict) -> Iterator[Any]: return chain.from_iterable(d.items()) all_handlers = {