Skip to content

Commit

Permalink
Removing field deletions and id generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelylendvai committed Jan 7, 2022
1 parent d204372 commit 5058172
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "36c891d9-4bd9-43ac-bad2-10e12756272c",
"name": "HubSpot",
"dockerRepository": "airbyte/source-hubspot",
"dockerImageTag": "0.1.29",
"dockerImageTag": "0.1.30",
"documentationUrl": "https://docs.airbyte.io/integrations/sources/hubspot",
"icon": "hubspot.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
- name: HubSpot
sourceDefinitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c
dockerRepository: airbyte/source-hubspot
dockerImageTag: 0.1.29
dockerImageTag: 0.1.30
documentationUrl: https://docs.airbyte.io/integrations/sources/hubspot
icon: hubspot.svg
sourceType: api
Expand Down
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.29
LABEL io.airbyte.version=0.1.30
LABEL io.airbyte.name=airbyte/source-hubspot
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from functools import lru_cache, partial
from http import HTTPStatus
from typing import Any, Callable, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Tuple, Union
from uuid import uuid4

import backoff
import pendulum as pendulum
Expand Down Expand Up @@ -716,8 +715,9 @@ class FormSubmissionStream(Stream):
def _transform(self, records: Iterable) -> Iterable:
for record in super()._transform(records):
keys = record.keys()
if "id" not in keys:
record["id"] = uuid4()

# There's no updatedAt field in the submission however forms fetched by using this field,
# so it has to be added to the submissions otherwise it would fail when calling _filter_old_records
if "updatedAt" not in keys:
record["updatedAt"] = record["submittedAt"]

Expand All @@ -726,9 +726,6 @@ def _transform(self, records: Iterable) -> Iterable:
def list(self, fields) -> Iterable:
for form in self.read(getter=partial(self._api.get, url="/marketing/v3/forms")):
for submission in self.read(getter=partial(self._api.get, url=f"{self.url}/{form['id']}")):
del submission["id"]
del submission["updatedAt"]

submission["formId"] = form["id"]
yield submission

Expand Down

0 comments on commit 5058172

Please sign in to comment.