Skip to content

Commit

Permalink
check for cursor in state in case state is empty
Browse files Browse the repository at this point in the history
also SurveyStream needs to define its form_id property before calling super.init
  • Loading branch information
Rohit Chatterjee committed Aug 17, 2024
1 parent 7b4c089 commit 9eedd84
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 9eedd84

Please sign in to comment.