Skip to content

Commit ad1fd2b

Browse files
authored
🐛 Source Hubspot: use RFC3339 datetime (#13159)
Signed-off-by: Sergey Chvalyuk <[email protected]>
1 parent 9d1cd42 commit ad1fd2b

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
- name: HubSpot
391391
sourceDefinitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c
392392
dockerRepository: airbyte/source-hubspot
393-
dockerImageTag: 0.1.59
393+
dockerImageTag: 0.1.60
394394
documentationUrl: https://docs.airbyte.io/integrations/sources/hubspot
395395
icon: hubspot.svg
396396
sourceType: api

airbyte-config/init/src/main/resources/seed/source_specs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3549,7 +3549,7 @@
35493549
supportsNormalization: false
35503550
supportsDBT: false
35513551
supported_destination_sync_modes: []
3552-
- dockerImage: "airbyte/source-hubspot:0.1.59"
3552+
- dockerImage: "airbyte/source-hubspot:0.1.60"
35533553
spec:
35543554
documentationUrl: "https://docs.airbyte.io/integrations/sources/hubspot"
35553555
connectionSpecification:

airbyte-integrations/connectors/source-hubspot/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ COPY source_hubspot ./source_hubspot
3434
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
3535
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
3636

37-
LABEL io.airbyte.version=0.1.59
37+
LABEL io.airbyte.version=0.1.60
3838
LABEL io.airbyte.name=airbyte/source-hubspot

airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def _convert_datetime_to_string(dt: pendulum.datetime, declared_format: str = No
372372
if declared_format == "date":
373373
return dt.to_date_string()
374374
elif declared_format == "date-time":
375-
return dt.to_datetime_string()
375+
return dt.to_rfc3339_string()
376376

377377
@classmethod
378378
def _cast_datetime(cls, field_name: str, field_value: Any, declared_format: str = None) -> Any:
@@ -1282,7 +1282,7 @@ def _transform(self, records: Iterable) -> Iterable:
12821282
continue
12831283
if versions:
12841284
for version in versions:
1285-
version["timestamp"] = self._field_to_datetime(version["timestamp"]).to_datetime_string()
1285+
version["timestamp"] = self._field_to_datetime(version["timestamp"]).to_rfc3339_string()
12861286
version["property"] = key
12871287
version["vid"] = vid
12881288
yield version

airbyte-integrations/connectors/source-hubspot/unit_tests/test_field_type_converting.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_bad_field_type_converting(field_type, expected, caplog, capsys):
7373
# Test casting fields with format specified
7474
(["null", "string"], "some_field", "", "date-time", None),
7575
(["string"], "some_field", "", "date-time", ""),
76-
(["null", "string"], "some_field", "2020", "date-time", "2020-01-01 00:00:00"),
76+
(["null", "string"], "some_field", "2020", "date-time", "2020-01-01T00:00:00+00:00"),
7777
],
7878
)
7979
def test_cast_type_if_needed(declared_field_types, field_name, field_value, format, casted_value):
@@ -89,14 +89,14 @@ def test_cast_type_if_needed(declared_field_types, field_name, field_value, form
8989
"field_value, declared_format, expected_casted_value",
9090
[
9191
("1653696000000", "date", "2022-05-28"),
92-
("1645608465000", "date-time", "2022-02-23 09:27:45"),
93-
(1645608465000, "date-time", "2022-02-23 09:27:45"),
92+
("1645608465000", "date-time", "2022-02-23T09:27:45+00:00"),
93+
(1645608465000, "date-time", "2022-02-23T09:27:45+00:00"),
9494
("2022-05-28", "date", "2022-05-28"),
95-
("2022-02-23 09:27:45", "date-time", "2022-02-23 09:27:45"),
95+
("2022-02-23 09:27:45", "date-time", "2022-02-23T09:27:45+00:00"),
9696
("", "date", ""),
9797
(None, "date", None),
9898
("2022-02-23 09:27:45", "date", "2022-02-23"),
99-
("2022-05-28", "date-time", "2022-05-28 00:00:00"),
99+
("2022-05-28", "date-time", "2022-05-28T00:00:00+00:00"),
100100
],
101101
)
102102
def test_cast_timestamp_to_date(field_value, declared_format, expected_casted_value):

docs/integrations/sources/hubspot.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ HubSpot's API will [rate limit](https://developers.hubspot.com/docs/api/usage-de
133133

134134
| Version | Date | Pull Request | Subject |
135135
|:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
136-
| 0.1.59 | 2022-05-10 | [\#12711](https://github.com/airbytehq/airbyte/pull/12711) | Ensure oauth2.0 token has all needed scopes in "check" command |
137-
| 0.1.58 | 2022-05-04 | [\#12482](https://github.com/airbytehq/airbyte/pull/12482) | Update input configuration copy |
138-
| 0.1.57 | 2022-05-04 | [12198](https://github.com/airbytehq/airbyte/pull/12198) | Add deals associations for quotes
136+
| 0.1.60 | 2022-05-25 | [\#13159](https://github.com/airbytehq/airbyte/pull/13159) | Use RFC3339 datetime |
137+
| 0.1.59 | 2022-05-10 | [\#12711](https://github.com/airbytehq/airbyte/pull/12711) | Ensure oauth2.0 token has all needed scopes in "check" command |
138+
| 0.1.58 | 2022-05-04 | [\#12482](https://github.com/airbytehq/airbyte/pull/12482) | Update input configuration copy |
139+
| 0.1.57 | 2022-05-04 | [12198](https://github.com/airbytehq/airbyte/pull/12198) | Add deals associations for quotes |
139140
| 0.1.56 | 2022-05-02 | [12515](https://github.com/airbytehq/airbyte/pull/12515) | Extra logs for troubleshooting 403 errors |
140141
| 0.1.55 | 2022-04-28 | [12424](https://github.com/airbytehq/airbyte/pull/12424) | Correct schema for ticket_pipeline stream |
141142
| 0.1.54 | 2022-04-28 | [12335](https://github.com/airbytehq/airbyte/pull/12335) | Mock time slep in unit test s |

0 commit comments

Comments
 (0)