Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingestion/fivetran): Fix fivetran get connector jobs bug #9975

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ def _get_jobs_list(self, connector_id: str) -> List[Job]:
# If no sync-end event log for this sync id that means sync is still in progress
continue

message_data = json.loads(sync_end_logs[sync_id][Constant.MESSAGE_DATA])
message_data = sync_end_logs[sync_id][Constant.MESSAGE_DATA]
if message_data is None:
continue
message_data = json.loads(message_data)
if isinstance(message_data, str):
# Sometimes message_data contains json string inside string
# Ex: '"{\"status\":\"SUCCESSFUL\"}"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def default_query_results(
"time_stamp": datetime.datetime(2023, 10, 3, 14, 35, 55, 401000),
"sync_id": "63c2fc85-600b-455f-9ba0-f576522465be",
},
{
"time_stamp": datetime.datetime(2023, 10, 3, 14, 37, 5, 403000),
"sync_id": "e773e1e9-c791-46f4-894f-8ch9b3dfc832",
},
]
elif query == fivetran_log_query.get_sync_end_logs_query("calendar_elected"):
return [
Expand All @@ -113,6 +117,11 @@ def default_query_results(
"sync_id": "63c2fc85-600b-455f-9ba0-f576522465be",
"message_data": '"{\\"reason\\":\\"java.lang.RuntimeException: FATAL: too many connections for role \\\\\\"hxwraqld\\\\\\"\\",\\"taskType\\":\\"reconnect\\",\\"status\\":\\"FAILURE_WITH_TASK\\"}"',
},
{
"time_stamp": datetime.datetime(2023, 10, 3, 14, 37, 35, 478000),
"sync_id": "e773e1e9-c791-46f4-894f-8ch9b3dfc832",
"message_data": None,
},
]
# Unreachable code
raise Exception(f"Unknown query {query}")
Expand Down
Loading