From ee5d3883e8ed89c4f243f9be2f52f3981b967e4b Mon Sep 17 00:00:00 2001 From: Rohit Chatterjee Date: Wed, 6 Dec 2023 12:29:01 +0530 Subject: [PATCH] use "end" as a cursor --- .../source_kobotoolbox/source.py | 15 +++++++++++++++ .../source_kobotoolbox/spec.yaml | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/source.py b/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/source.py index 692e4b6bcb98..bee066981cd4 100644 --- a/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/source.py +++ b/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/source.py @@ -196,6 +196,12 @@ class KoboStreamEndTime(KoboToolStream): cursor_field = "endtime" +class KoboStreamEnd(KoboToolStream): + """KoboStreamEnd""" + + cursor_field = "end" + + class SourceKobotoolbox(AbstractSource): """One instance per sync""" @@ -258,6 +264,15 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: pagination_limit=self.PAGINATION_LIMIT, auth_token=auth_token, ) + elif "forms_using_end" in config and form_dict["name"] in config["forms_using_end"]: + stream = KoboStreamEnd( + config=config, + form_id=form_dict["uid"], + schema=stream_json_schema, + name=form_dict["name"], + pagination_limit=self.PAGINATION_LIMIT, + auth_token=auth_token, + ) else: stream = KoboStreamSubmissionTime( config=config, diff --git a/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/spec.yaml b/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/spec.yaml index 1c742d0f7e64..a0404d2e3cf8 100644 --- a/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/spec.yaml +++ b/airbyte-integrations/connectors/source-kobotoolbox/source_kobotoolbox/spec.yaml @@ -46,6 +46,11 @@ connectionSpecification: title: Forms Using Endtime description: List of forms that use endtime instead of submission time order: 6 + forms_using_end: + type: array + title: Forms Using End + description: List of forms that use end instead of submission time + order: 6 max_days_to_close: type: integer title: Max Days To Close