Skip to content

Commit

Permalink
Merge pull request #59 from DalgoT4D/kobotoolbox-for-050
Browse files Browse the repository at this point in the history
return each record inside {data}
  • Loading branch information
fatchat authored Oct 11, 2023
2 parents fa6911b + 30e6cb5 commit 7b86e7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.0
LABEL io.airbyte.name=airbyte/source-kobotoolbox
LABEL io.airbyte.name=tech4dev/source-kobotoolbox
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
"null",
]
},
"endtime": {"type": ["string", "null"]},
"data": {
"type": "object",
},
"_submission_time": {"type": ["string", "null"]},
},
}

Expand Down Expand Up @@ -59,7 +62,7 @@ def name(self) -> str:
s = s.strip()
return s if len(s) > 0 else self.form_id

# State will be a dict : {'endtime': '2023-03-15T00:00:00.000+05:30'}
# State will be a dict : {'_submission_time': '2023-03-15T00:00:00.000+05:30'}

@property
def state(self) -> Mapping[str, Any]:
Expand Down Expand Up @@ -111,7 +114,9 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp
for to_remove_field in self.exclude_fields:
if to_remove_field in record:
record.pop(to_remove_field)
yield record
retval = {"_id": record["_id"], "data": record}
retval[self.cursor_field] = record[self.cursor_field]
yield retval

def read_records(self, *args, **kwargs) -> Iterable[Mapping[str, Any]]:
for record in super().read_records(*args, **kwargs):
Expand Down

0 comments on commit 7b86e7d

Please sign in to comment.