From ae48025525c3bb1e3767394e5085f1a7a5b332af Mon Sep 17 00:00:00 2001 From: melgazar9 Date: Tue, 10 Oct 2023 20:12:00 -0500 Subject: [PATCH] rename fn --- tap_mongodb/streams.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tap_mongodb/streams.py b/tap_mongodb/streams.py index 71c5de3..5aa62cf 100644 --- a/tap_mongodb/streams.py +++ b/tap_mongodb/streams.py @@ -30,18 +30,18 @@ DEFAULT_START_DATE: str = "1970-01-01" -def recursive_replace_inf_in_dict(dct): +def recursive_replace_empty_in_dict(dct): for key, value in dct.items(): if value in [-math.inf, math.inf, math.nan]: dct[key] = None elif isinstance(value, list): for i, item in enumerate(value): if isinstance(item, dict): - recursive_replace_inf_in_dict(item) + recursive_replace_empty_in_dict(item) elif item in [-math.inf, math.inf, math.nan]: value[i] = None elif isinstance(value, dict): - recursive_replace_inf_in_dict(value) + recursive_replace_empty_in_dict(value) return def to_object_id(replication_key_value: str) -> ObjectId: @@ -214,7 +214,7 @@ def get_records(self, context: dict | None) -> Iterable[dict]: object_id: ObjectId = record["_id"] incremental_id: IncrementalId = IncrementalId.from_object_id(object_id) - recursive_replace_inf_in_dict(record) + recursive_replace_empty_in_dict(record) parsed_record = { "replication_key": str(incremental_id),