From fc42fbd04847a1887fcda80c586d1a44f0880d3f Mon Sep 17 00:00:00 2001 From: Felipe Guilherme Sabino <982190+sabino@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:10:35 -0300 Subject: [PATCH] fix: state_type incorrect reference (#11) --- tap_airbyte/tap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tap_airbyte/tap.py b/tap_airbyte/tap.py index bd2ee02..78f0988 100644 --- a/tap_airbyte/tap.py +++ b/tap_airbyte/tap.py @@ -654,13 +654,14 @@ def sync_all(self) -> None: # type: ignore self._process_log_message(airbyte_message) elif airbyte_message["type"] == AirbyteMessage.STATE: state_message = airbyte_message["state"] + state_type = state_message["type"] if "data" in state_message: unpacked_state = state_message["data"] - elif "type" == "STREAM": + elif state_type == "STREAM": unpacked_state = state_message["stream"] - elif "type" == "GLOBAL": + elif state_type == "GLOBAL": unpacked_state = state_message["global"] - elif "type" == "LEGACY": + elif state_type == "LEGACY": unpacked_state = state_message["legacy"] self.airbyte_state = unpacked_state with STDOUT_LOCK: