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: add new stream Feedback Submissions #34048

1 change: 1 addition & 0 deletions airbyte-integrations/connectors/source-hubspot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The primary key for the following streams is `id`:
- engagements_meetings
- engagements_notes
- engagements_tasks
- feedback_submissions
- forms
- goals
- line_items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@
"stream_state": { "updatedAt": "2221-10-12T13:37:56.412000+00:00" }
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "feedback_submissions"
},
"stream_state": {
"updatedAt": "2221-10-12T13:37:56.412000+00:00"
}
}
},
{
"type": "STREAM",
"stream": {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c
dockerImageTag: 2.0.2
dockerImageTag: 2.1.0
dockerRepository: airbyte/source-hubspot
documentationUrl: https://docs.airbyte.com/integrations/sources/hubspot
githubIssueLabel: source-hubspot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@
"cursor_field": ["updatedAt"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "feedback_submissions",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "forms",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "feedback_submissions",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "form_submissions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "feedback_submissions",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "forms",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "feedback_submissions",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "form_submissions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@
"cursor_field": ["updatedAt"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "feedback_submissions",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["updatedAt"]
},
"sync_mode": "incremental",
"cursor_field": ["updatedAt"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "forms",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
"stream_descriptor": { "name": "tickets" }
}
},
{
"type": "STREAM",
"stream": {
"stream_state": { "updatedAt": "2021-02-23T00:00:00Z" },
"stream_descriptor": { "name": "feedback_submissions" }
}
},
{
"type": "STREAM",
"stream": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
EngagementsNotesWebAnalytics,
EngagementsTasks,
EngagementsTasksWebAnalytics,
FeedbackSubmissions,
Forms,
FormSubmissions,
Goals,
Expand Down Expand Up @@ -130,6 +131,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
EngagementsMeetings(**common_params),
EngagementsNotes(**common_params),
EngagementsTasks(**common_params),
FeedbackSubmissions(**common_params),
Forms(**common_params),
FormSubmissions(**common_params),
Goals(**common_params),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,6 @@ class EngagementsTasks(CRMSearchStream):
scopes = {"crm.objects.contacts.read"}


# this stream uses a beta endpoint thus is unstable and disabled
class FeedbackSubmissions(CRMObjectIncrementalStream):
entity = "feedback_submissions"
associations = ["contacts"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_streams(requests_mock, config_experimental):

streams = SourceHubspot().streams(config_experimental)

assert len(streams) == 44
assert len(streams) == 45


def test_custom_streams(config_experimental):
Expand Down Expand Up @@ -139,14 +139,14 @@ def test_cast_datetime(common_params, caplog):

Companies(**common_params)._cast_datetime(field_name, field_value)

expected_warining_message = {
expected_warning_message = {
"type": "LOG",
"log": {
"level": "WARN",
"message": f"Couldn't parse date/datetime string in {field_name}, trying to parse timestamp... Field value: {field_value}. Ex: argument 'input': 'DateTime' object cannot be converted to 'PyString'",
},
}
assert expected_warining_message["log"]["message"] in caplog.text
assert expected_warning_message["log"]["message"] in caplog.text


def test_check_connection_backoff_on_limit_reached(requests_mock, config):
Expand Down Expand Up @@ -709,13 +709,13 @@ def test_pagination_marketing_emails_stream(requests_mock, common_params):
def test_get_granted_scopes(requests_mock, mocker):
authenticator = mocker.Mock()
authenticator.get_access_token.return_value = "the-token"

expected_scopes = ["a", "b", "c"]
response = [
{"json": {"scopes": expected_scopes}, "status_code": 200},
]
requests_mock.register_uri("GET", "https://api.hubapi.com/oauth/v1/access-tokens/the-token", response)

actual_scopes = SourceHubspot().get_granted_scopes(authenticator)

assert expected_scopes == actual_scopes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
EngagementsMeetings,
EngagementsNotes,
EngagementsTasks,
FeedbackSubmissions,
Forms,
FormSubmissions,
Goals,
Expand Down Expand Up @@ -101,6 +102,7 @@ def test_updated_at_field_non_exist_handler(requests_mock, common_params, fake_p
(EngagementsMeetings, "meetings", {"updatedAt": "2022-02-25T16:43:11Z"}),
(EngagementsNotes, "notes", {"updatedAt": "2022-02-25T16:43:11Z"}),
(EngagementsTasks, "tasks", {"updatedAt": "2022-02-25T16:43:11Z"}),
(FeedbackSubmissions, "feedback_submissions", {"updatedAt": "2022-02-25T16:43:11Z"}),
(Forms, "form", {"updatedAt": "2022-02-25T16:43:11Z"}),
(FormSubmissions, "form", {"updatedAt": "2022-02-25T16:43:11Z"}),
(Goals, "goal_targets", {"updatedAt": "2022-02-25T16:43:11Z"}),
Expand Down
3 changes: 3 additions & 0 deletions docs/integrations/sources/hubspot.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Next, you need to configure the appropriate scopes for the following streams. Pl
| `email_subscriptions` | `content` |
| `engagements` | `crm.objects.companies.read`, `crm.objects.contacts.read`, `crm.objects.deals.read`, `tickets`, `e-commerce` |
| `engagements_emails` | `sales-email-read` |
| `feedback_submissions` | `crm.objects.feedback_submissions.read`
| `forms` | `forms` |
| `form_submissions` | `forms` |
| `goals` | `crm.objects.goals.read` |
Expand Down Expand Up @@ -179,6 +180,7 @@ The HubSpot source connector supports the following streams:
- [Engagements Meetings](https://developers.hubspot.com/docs/api/crm/meetings) \(Incremental\)
- [Engagements Notes](https://developers.hubspot.com/docs/api/crm/notes) \(Incremental\)
- [Engagements Tasks](https://developers.hubspot.com/docs/api/crm/tasks) \(Incremental\)
- [Feedback Submissions](https://developers.hubspot.com/docs/api/crm/feedback-submissions) \(Client-Side Incremental\)
- [Forms](https://developers.hubspot.com/docs/api/marketing/forms) \(Client-Side Incremental\)
- [Form Submissions](https://legacydocs.hubspot.com/docs/methods/forms/get-submissions-for-a-form) \(Client-Side Incremental\)
- [Goals](https://developers.hubspot.com/docs/api/crm/goals) \(Incremental\)
Expand Down Expand Up @@ -304,6 +306,7 @@ The connector is restricted by normal HubSpot [rate limitations](https://legacyd

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 2.1.0 | 2024-01-09 | [34048](https://github.com/airbytehq/airbyte/pull/34048) | Added Feedback Submissions
| 2.0.2 | 2023-12-15 | [33844](https://github.com/airbytehq/airbyte/pull/33844) | Make property_history PK combined to support Incremental/Deduped sync type |
| 2.0.1 | 2023-12-15 | [33527](https://github.com/airbytehq/airbyte/pull/33527) | Make query string calculated correctly for ProertyHistory streams to avoid 414 HTTP Errors |
| 2.0.0 | 2023-12-08 | [33266](https://github.com/airbytehq/airbyte/pull/33266) | Added ContactsPropertyHistory, CompaniesPropertyHistory, DealsPropertyHistory streams |
Expand Down
Loading