Skip to content

Commit

Permalink
#291 oncall. Source Hubspot: disable Incremental mode for PropertyHis…
Browse files Browse the repository at this point in the history
…tory stream and decrease number of http requests made
  • Loading branch information
davydov-d committed Jul 13, 2022
1 parent 48f8f2f commit 5cbba63
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-hubspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ COPY source_hubspot ./source_hubspot
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.72
LABEL io.airbyte.version=0.1.73
LABEL io.airbyte.name=airbyte/source-hubspot
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "property_history",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "products",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "property_history",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "subscription_changes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,6 @@
"cursor_field": ["updatedAt"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "property_history",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"default_cursor_field": ["timestamp"]
},
"sync_mode": "incremental",
"cursor_field": ["timestamp"],
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "quotes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ class Owners(Stream):
scopes = {"crm.objects.owners.read"}


class PropertyHistory(IncrementalStream):
class PropertyHistory(Stream):
"""Contacts Endpoint, API v1
Is used to get all Contacts and the history of their respective
Properties. Whenever a property is changed it is added here.
Expand All @@ -1295,9 +1295,10 @@ class PropertyHistory(IncrementalStream):
created_at_field = "timestamp"
entity = "contacts"
data_field = "contacts"
page_field = "vid-offset"
page_filter = "vidOffset"
page_field = "time-offset"
page_filter = "timeOffset"
denormalize_records = True
limit_field = "count"
limit = 100
scopes = {"crm.objects.contacts.read"}

Expand All @@ -1307,8 +1308,9 @@ def request_params(
stream_slice: Mapping[str, Any] = None,
next_page_token: Mapping[str, Any] = None,
) -> MutableMapping[str, Any]:
params = super().request_params(stream_state, stream_slice, next_page_token)
params.update(propertyMode="value_and_history")
params = {self.limit_field: self.limit, "propertyMode": "value_and_history"}
if next_page_token:
params.update(next_page_token)
return params

def _transform(self, records: Iterable) -> Iterable:
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/hubspot.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Now that you have set up the HubSpot source connector, check out the following H

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
| 0.1.73 | 2022-07-13 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Decrease number of http requests made, disable Incremental mode for PropertyHistory stream |
| 0.1.72 | 2022-06-24 | [14054](https://github.com/airbytehq/airbyte/pull/14054) | Extended error logging |
| 0.1.71 | 2022-06-24 | [14102](https://github.com/airbytehq/airbyte/pull/14102) | Removed legacy `AirbyteSentry` dependency from the code |
| 0.1.70 | 2022-06-16 | [13837](https://github.com/airbytehq/airbyte/pull/13837) | Fix the missing data in CRM streams issue |
Expand Down

0 comments on commit 5cbba63

Please sign in to comment.