Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Source Hubspot: use RFC3339 datetime #13159

Merged
merged 5 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.59
LABEL io.airbyte.version=0.1.60
LABEL io.airbyte.name=airbyte/source-hubspot
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
7 changes: 4 additions & 3 deletions docs/integrations/sources/hubspot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down