From 4373cb8ae0d85650e19993d60f766d85e5822934 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Wed, 25 May 2022 07:29:55 +0300 Subject: [PATCH 1/4] to_datetime_string -> to_rfc3339_string Signed-off-by: Sergey Chvalyuk --- .../source-hubspot/source_hubspot/streams.py | 2 +- .../unit_tests/test_field_type_converting.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py index 47ca31e016731..752ef7577081c 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py @@ -372,7 +372,7 @@ def _convert_datetime_to_string(dt: pendulum.datetime, declared_format: str = No if declared_format == "date": return dt.to_date_string() elif declared_format == "date-time": - return dt.to_datetime_string() + return dt.to_rfc3339_string() @classmethod def _cast_datetime(cls, field_name: str, field_value: Any, declared_format: str = None) -> Any: diff --git a/airbyte-integrations/connectors/source-hubspot/unit_tests/test_field_type_converting.py b/airbyte-integrations/connectors/source-hubspot/unit_tests/test_field_type_converting.py index 798902cdde626..2848241091dc8 100644 --- a/airbyte-integrations/connectors/source-hubspot/unit_tests/test_field_type_converting.py +++ b/airbyte-integrations/connectors/source-hubspot/unit_tests/test_field_type_converting.py @@ -73,7 +73,7 @@ def test_bad_field_type_converting(field_type, expected, caplog, capsys): # Test casting fields with format specified (["null", "string"], "some_field", "", "date-time", None), (["string"], "some_field", "", "date-time", ""), - (["null", "string"], "some_field", "2020", "date-time", "2020-01-01 00:00:00"), + (["null", "string"], "some_field", "2020", "date-time", "2020-01-01T00:00:00+00:00"), ], ) 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 "field_value, declared_format, expected_casted_value", [ ("1653696000000", "date", "2022-05-28"), - ("1645608465000", "date-time", "2022-02-23 09:27:45"), - (1645608465000, "date-time", "2022-02-23 09:27:45"), + ("1645608465000", "date-time", "2022-02-23T09:27:45+00:00"), + (1645608465000, "date-time", "2022-02-23T09:27:45+00:00"), ("2022-05-28", "date", "2022-05-28"), - ("2022-02-23 09:27:45", "date-time", "2022-02-23 09:27:45"), + ("2022-02-23 09:27:45", "date-time", "2022-02-23T09:27:45+00:00"), ("", "date", ""), (None, "date", None), ("2022-02-23 09:27:45", "date", "2022-02-23"), - ("2022-05-28", "date-time", "2022-05-28 00:00:00"), + ("2022-05-28", "date-time", "2022-05-28T00:00:00+00:00"), ], ) def test_cast_timestamp_to_date(field_value, declared_format, expected_casted_value): From 4c3170c06c6ee560b42e526c741e31a1aaa13c4a Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Wed, 25 May 2022 07:58:34 +0300 Subject: [PATCH 2/4] change to to_rfc3339_string (2) Signed-off-by: Sergey Chvalyuk --- .../connectors/source-hubspot/source_hubspot/streams.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py index 752ef7577081c..6cee5364b7efe 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py @@ -1282,7 +1282,7 @@ def _transform(self, records: Iterable) -> Iterable: continue if versions: for version in versions: - version["timestamp"] = self._field_to_datetime(version["timestamp"]).to_datetime_string() + version["timestamp"] = self._field_to_datetime(version["timestamp"]).to_rfc3339_string() version["property"] = key version["vid"] = vid yield version From 604d067cabb51267eaa2ffe4e94b9e8b0d5d9115 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Wed, 25 May 2022 08:02:01 +0300 Subject: [PATCH 3/4] 0.1.59 -> 0.1.60 Signed-off-by: Sergey Chvalyuk --- airbyte-integrations/connectors/source-hubspot/Dockerfile | 2 +- docs/integrations/sources/hubspot.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-hubspot/Dockerfile b/airbyte-integrations/connectors/source-hubspot/Dockerfile index 8e61ae2aae279..08d11cd60584d 100644 --- a/airbyte-integrations/connectors/source-hubspot/Dockerfile +++ b/airbyte-integrations/connectors/source-hubspot/Dockerfile @@ -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.59 +LABEL io.airbyte.version=0.1.60 LABEL io.airbyte.name=airbyte/source-hubspot diff --git a/docs/integrations/sources/hubspot.md b/docs/integrations/sources/hubspot.md index 9da35b236ced2..5c2f5ba9f04b2 100644 --- a/docs/integrations/sources/hubspot.md +++ b/docs/integrations/sources/hubspot.md @@ -149,9 +149,10 @@ If you are using OAuth, most of the streams require the appropriate [scopes](htt | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------| -| 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 | -| 0.1.58 | 2022-05-04 | [\#12482](https://github.com/airbytehq/airbyte/pull/12482) | Update input configuration copy | -| 0.1.57 | 2022-05-04 | [12198](https://github.com/airbytehq/airbyte/pull/12198) | Add deals associations for quotes +| 0.1.60 | 2022-05-25 | [\#13159](https://github.com/airbytehq/airbyte/pull/13159) | Use RFC3339 datetime | +| 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 | +| 0.1.58 | 2022-05-04 | [\#12482](https://github.com/airbytehq/airbyte/pull/12482) | Update input configuration copy | +| 0.1.57 | 2022-05-04 | [12198](https://github.com/airbytehq/airbyte/pull/12198) | Add deals associations for quotes | | 0.1.56 | 2022-05-02 | [12515](https://github.com/airbytehq/airbyte/pull/12515) | Extra logs for troubleshooting 403 errors | | 0.1.55 | 2022-04-28 | [12424](https://github.com/airbytehq/airbyte/pull/12424) | Correct schema for ticket_pipeline stream | | 0.1.54 | 2022-04-28 | [12335](https://github.com/airbytehq/airbyte/pull/12335) | Mock time slep in unit test s | From c24a97514314da421fba9782d11a8ced91f344df Mon Sep 17 00:00:00 2001 From: Octavia Squidington III Date: Mon, 30 May 2022 12:53:12 +0000 Subject: [PATCH 4/4] auto-bump connector version --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- airbyte-config/init/src/main/resources/seed/source_specs.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index e665b3d04391d..f855aacfd66a0 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -390,7 +390,7 @@ - name: HubSpot sourceDefinitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c dockerRepository: airbyte/source-hubspot - dockerImageTag: 0.1.59 + dockerImageTag: 0.1.60 documentationUrl: https://docs.airbyte.io/integrations/sources/hubspot icon: hubspot.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index dc4292b4b9dfe..941f1e58fc03f 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -3549,7 +3549,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-hubspot:0.1.59" +- dockerImage: "airbyte/source-hubspot:0.1.60" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/hubspot" connectionSpecification: