Skip to content

Commit

Permalink
8906 Output only records in which cursor field is greater than the va…
Browse files Browse the repository at this point in the history
…lue in state for incremental streams
  • Loading branch information
Zirochkaa committed Jan 17, 2022
1 parent 25fb7e7 commit e854da1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.2
LABEL io.airbyte.version=0.1.3
LABEL io.airbyte.name=airbyte/source-delighted
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

# Basic full refresh stream
class DelightedStream(HttpStream, ABC):

url_base = "https://api.delighted.com/v1/"

# Page size
Expand Down Expand Up @@ -52,7 +51,7 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp


class IncrementalDelightedStream(DelightedStream, ABC):
# Getting page size as 'limit' from parrent class
# Getting page size as 'limit' from parent class
@property
def limit(self):
return super().limit
Expand All @@ -73,6 +72,11 @@ def request_params(self, stream_state=None, **kwargs):
params["since"] = stream_state.get(self.cursor_field)
return params

def parse_response(self, response: requests.Response, stream_state: Mapping[str, Any], **kwargs) -> Iterable[Mapping]:
for record in super().parse_response(response=response, stream_state=stream_state, **kwargs):
if self.cursor_field not in stream_state or record[self.cursor_field] > stream_state[self.cursor_field]:
yield record


class People(IncrementalDelightedStream):
def path(self, **kwargs) -> str:
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/delighted.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This connector supports `API PASSWORD` as the authentication method.

| Version | Date | Pull Request | Subject |
| :--- | :--- | :--- | :--- |
| 0.1.3 | 2022-01-18 | [9550](https://github.com/airbytehq/airbyte/pull/9550) | Output only records in which cursor field is greater than the value in state for incremental streams |
| 0.1.2 | 2022-01-06 | [9333](https://github.com/airbytehq/airbyte/pull/9333) | Add incremental sync mode to streams in `integration_tests/configured_catalog.json` |
| 0.1.1 | 2022-01-04 | [9275](https://github.com/airbytehq/airbyte/pull/9275) | Fix pagination handling for `survey_responses`, `bounces` and `unsubscribes` streams |
| 0.1.0 | 2021-10-27 | [4551](https://github.com/airbytehq/airbyte/pull/4551) | Add Delighted source connector |

0 comments on commit e854da1

Please sign in to comment.