From 1959ab57e0e345045d56fe3528b764d726c2f570 Mon Sep 17 00:00:00 2001 From: prijendev Date: Fri, 14 Feb 2025 17:44:33 +0530 Subject: [PATCH 1/5] Decode binary value to base64 on error --- tap_mongodb/sync_strategies/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tap_mongodb/sync_strategies/common.py b/tap_mongodb/sync_strategies/common.py index 2843d90..8bfaeea 100644 --- a/tap_mongodb/sync_strategies/common.py +++ b/tap_mongodb/sync_strategies/common.py @@ -145,7 +145,11 @@ def transform_value(value, path): if isinstance(value, bson.int64.Int64): return int(value) if isinstance(value, Binary): - return str(value.as_uuid(value.subtype)) + try: + return str(value.as_uuid(value.subtype)) + except ValueError: + LOGGER.warning("Binary value is not a UUID, returning value itself") + return base64.b64encode(value).decode('utf-8') if isinstance(value, bytes): # Return the original base64 encoded string return base64.b64encode(value).decode('utf-8') From 56b27a88f3e4bd8bc4f3d1707c88619596424c90 Mon Sep 17 00:00:00 2001 From: prijendev Date: Fri, 14 Feb 2025 18:14:06 +0530 Subject: [PATCH 2/5] Another PR alpha From 679847bef88e67216b6ec417fb7125c3d0a7356e Mon Sep 17 00:00:00 2001 From: prijendev Date: Fri, 14 Feb 2025 18:51:57 +0530 Subject: [PATCH 3/5] New commit for PR alpha From d2af18a0c5b8d949fcc22fa466ba9d60f14136a6 Mon Sep 17 00:00:00 2001 From: prijendev Date: Fri, 14 Feb 2025 18:55:36 +0530 Subject: [PATCH 4/5] Commit 2 for PR alpha From e1f29e49179d53ad199b888752495e039cd5b983 Mon Sep 17 00:00:00 2001 From: prijendev Date: Fri, 14 Feb 2025 19:15:13 +0530 Subject: [PATCH 5/5] Commit 3 for PR alpha