Skip to content

Commit

Permalink
use "end" as a cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Chatterjee committed Dec 6, 2023
1 parent c703b88 commit ee5d388
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ class KoboStreamEndTime(KoboToolStream):
cursor_field = "endtime"


class KoboStreamEnd(KoboToolStream):
"""KoboStreamEnd"""

cursor_field = "end"


class SourceKobotoolbox(AbstractSource):
"""One instance per sync"""

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee5d388

Please sign in to comment.