From 9eedd8438595041b49c07836c5fc71dc26b02512 Mon Sep 17 00:00:00 2001 From: Rohit Chatterjee Date: Sat, 17 Aug 2024 19:21:01 +0530 Subject: [PATCH] check for cursor in state in case state is empty also SurveyStream needs to define its form_id property before calling super.init --- .../connectors/source-surveycto/source_surveycto/source.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-surveycto/source_surveycto/source.py b/airbyte-integrations/connectors/source-surveycto/source_surveycto/source.py index 67d27eec9900..2a78eb9b6569 100644 --- a/airbyte-integrations/connectors/source-surveycto/source_surveycto/source.py +++ b/airbyte-integrations/connectors/source-surveycto/source_surveycto/source.py @@ -34,10 +34,12 @@ }, } + class SurveyStream(HttpStream, ABC): transformer: TypeTransformer = TypeTransformer(TransformConfig.DefaultSchemaNormalization) def __init__(self, config: Mapping[str, Any], form_id, schema, **kwargs): + self.form_id = None super().__init__() self.config = config @@ -76,7 +78,8 @@ def state(self) -> Mapping[str, Any]: @state.setter def state(self, value: Mapping[str, Any]): - self._cursor_value = value[self.cursor_field] + if self.cursor_field in value: + self._cursor_value = value[self.cursor_field] @property def name(self) -> str: