Skip to content

Commit

Permalink
🐛 Source-Snapchat: always set the full state object (#20498)
Browse files Browse the repository at this point in the history
* always set the full state

* format

* format

* remove debug prints

* assign the full object

* update

* Update

* auto-bump connector version

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
  • Loading branch information
girarda and octavia-squidington-iii authored Dec 15, 2022
1 parent 2392acb commit 90c17de
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@
- name: Snapchat Marketing
sourceDefinitionId: 200330b2-ea62-4d11-ac6d-cfe3e3f8ab2b
dockerRepository: airbyte/source-snapchat-marketing
dockerImageTag: 0.1.8
dockerImageTag: 0.1.9
documentationUrl: https://docs.airbyte.com/integrations/sources/snapchat-marketing
icon: snapchat.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13603,7 +13603,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-snapchat-marketing:0.1.8"
- dockerImage: "airbyte/source-snapchat-marketing:0.1.9"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/snapchat-marketing"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ COPY source_snapchat_marketing ./source_snapchat_marketing
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.8
LABEL io.airbyte.version=0.1.9
LABEL io.airbyte.name=airbyte/source-snapchat-marketing
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"earned_reach",
]


logger = logging.getLogger("airbyte")


Expand Down Expand Up @@ -476,15 +475,15 @@ def update_state_after_last_record(self, record):
self.number_of_last_records += 1
# Update state if 'last' records for all dependant entities have been read
if self.number_of_parent_ids == self.number_of_last_records:
self.state = record_end_date
self.state = {self.cursor_field: record_end_date}

@property
def state(self):
return self._state

@state.setter
def state(self, value):
self._state[self.cursor_field] = value
self._state = value

def parse_response(
self,
Expand All @@ -498,7 +497,7 @@ def parse_response(

# Update state for each date slice (start_date), it ensures that previous date slices have been read
# and can be skipped in next incremental sync
self.state = stream_slice[self.cursor_field]
self.state = {self.cursor_field: stream_slice[self.cursor_field]}

for record in super().parse_response(
response=response, stream_state=stream_state, stream_slice=stream_slice, next_page_token=next_page_token
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/snapchat-marketing.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Snapchat Marketing API has limitations to 1000 items per page.
| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------|
| 0.1.9 | 2022-12-14 | [20498](https://github.com/airbytehq/airbyte/pull/20498) | Fix output state when no records are read |
| 0.1.8 | 2022-10-05 | [17596](https://github.com/airbytehq/airbyte/pull/17596) | Retry 429 and 5xx errors when refreshing access token |
| 0.1.6 | 2022-07-21 | [14924](https://github.com/airbytehq/airbyte/pull/14924) | Remove `additionalProperties` field from specs |
| 0.1.5 | 2022-07-13 | [14577](https://github.com/airbytehq/airbyte/pull/14577) | Added stats streams hourly, daily, lifetime |
Expand Down

0 comments on commit 90c17de

Please sign in to comment.