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: Fix issue with getting 414 HTTP error for streams #6954

Merged
merged 14 commits into from
Oct 26, 2021

Conversation

yevhenii-ldv
Copy link
Contributor

@yevhenii-ldv yevhenii-ldv commented Oct 11, 2021

What

resolves #3977 and #5835.

Pre-merge Checklist

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Oct 11, 2021
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 11, 2021

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1329684665
✅ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1329684665
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                       Stmts   Miss  Cover
	 --------------------------------------------------------------
	 base_python/__init__.py                       13      0   100%
	 base_python/catalog_helpers.py                10      6    40%
	 base_python/cdk/__init__.py                    0      0   100%
	 base_python/cdk/abstract_source.py            83     59    29%
	 base_python/cdk/streams/__init__.py            0      0   100%
	 base_python/cdk/streams/auth/__init__.py       0      0   100%
	 base_python/cdk/streams/auth/core.py           8      1    88%
	 base_python/cdk/streams/auth/jwt.py            5      5     0%
	 base_python/cdk/streams/auth/oauth.py         37     26    30%
	 base_python/cdk/streams/auth/token.py          9      4    56%
	 base_python/cdk/streams/core.py               63     32    49%
	 base_python/cdk/streams/exceptions.py         10      2    80%
	 base_python/cdk/streams/http.py               67     33    51%
	 base_python/cdk/streams/rate_limiting.py      30     14    53%
	 base_python/cdk/utils/__init__.py              0      0   100%
	 base_python/cdk/utils/casing.py                4      0   100%
	 base_python/client.py                         56     33    41%
	 base_python/entrypoint.py                     70     56    20%
	 base_python/integration.py                    52     25    52%
	 base_python/logger.py                         33     19    42%
	 base_python/schema_helpers.py                 56     41    27%
	 base_python/source.py                         51     34    33%
	 main_dev.py                                    3      3     0%
	 --------------------------------------------------------------
	 TOTAL                                        660    393    40%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                         Stmts   Miss  Cover
	 ------------------------------------------------
	 main_dev.py                      6      6     0%
	 source_hubspot/__init__.py       2      0   100%
	 source_hubspot/api.py          387    138    64%
	 source_hubspot/client.py        37     12    68%
	 source_hubspot/errors.py         6      0   100%
	 source_hubspot/source.py         4      0   100%
	 ------------------------------------------------
	 TOTAL                          442    156    65%

@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 11, 2021 15:56 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 11, 2021 15:58 Inactive
@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 12, 2021 11:21 Inactive
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I think we should go with a character-length-based check to prevent this issue from happening again (what is the max length we can use?)
  2. we should have very thorough unit tests around this functionality to ensure data integrity and correct pagination/merging records/making the correct requests/etc....

@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 13, 2021 11:38 Inactive
…urochkin/hubspot-source-issue-with-414-errors

� Conflicts:
�	airbyte-integrations/connectors/source-hubspot/sample_files/configured_catalog_for_oauth_config.json
�	airbyte-integrations/connectors/source-hubspot/sample_files/full_refresh_catalog.json
�	docs/integrations/sources/hubspot.md
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 18, 2021

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1356525664
❌ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1356525664
🐛 https://gradle.com/s/mi7raidwrsmcc

@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 18, 2021 21:15 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 18, 2021 21:17 Inactive
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 18, 2021

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1356560301
✅ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1356560301
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                       Stmts   Miss  Cover
	 --------------------------------------------------------------
	 base_python/__init__.py                       13      0   100%
	 base_python/catalog_helpers.py                10      6    40%
	 base_python/cdk/__init__.py                    0      0   100%
	 base_python/cdk/abstract_source.py            83     59    29%
	 base_python/cdk/streams/__init__.py            0      0   100%
	 base_python/cdk/streams/auth/__init__.py       0      0   100%
	 base_python/cdk/streams/auth/core.py           8      1    88%
	 base_python/cdk/streams/auth/jwt.py            5      5     0%
	 base_python/cdk/streams/auth/oauth.py         37     26    30%
	 base_python/cdk/streams/auth/token.py          9      4    56%
	 base_python/cdk/streams/core.py               63     32    49%
	 base_python/cdk/streams/exceptions.py         10      2    80%
	 base_python/cdk/streams/http.py               67     33    51%
	 base_python/cdk/streams/rate_limiting.py      30     14    53%
	 base_python/cdk/utils/__init__.py              0      0   100%
	 base_python/cdk/utils/casing.py                4      0   100%
	 base_python/client.py                         56     33    41%
	 base_python/entrypoint.py                     70     56    20%
	 base_python/integration.py                    52     25    52%
	 base_python/logger.py                         33     19    42%
	 base_python/schema_helpers.py                 56     41    27%
	 base_python/source.py                         51     34    33%
	 main_dev.py                                    3      3     0%
	 --------------------------------------------------------------
	 TOTAL                                        660    393    40%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                         Stmts   Miss  Cover
	 ------------------------------------------------
	 main_dev.py                      6      6     0%
	 source_hubspot/__init__.py       2      0   100%
	 source_hubspot/api.py          400     91    77%
	 source_hubspot/client.py        40     12    70%
	 source_hubspot/errors.py         6      0   100%
	 source_hubspot/source.py         4      0   100%
	 ------------------------------------------------
	 TOTAL                          458    109    76%

@yevhenii-ldv
Copy link
Contributor Author

@sherifnada could you please make code review one more time?

@@ -17,6 +17,8 @@
from base_python.entrypoint import logger
from source_hubspot.errors import HubspotAccessDenied, HubspotInvalidAuth, HubspotRateLimited, HubspotTimeout

PROPERTIES_PARAM_MAX_LENGTH = 15000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were you able to confirm this is the max allowed length? is there a reference you can include for the next person looking at the code? (or rather, how did you get this number? can you leave a comment about it?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not found any information on this in the Hubspot documentation or support anywhere. The user has a similar problem as we do, he described it here, but he was also not answered correctly to his question.
I obtained this value experimentally, using various URLs for Hubspot, I found that somewhere on the border of 16400 characters in URL, the Hubspot starts returning us a 414 error.
I put 15000 as a constant for the length of the "property" value only, and leaving about 1000 for the rest of the URL (basic URL, pagination, additional fields such as associations and contacts).

I`ll leave a comment inside the code about this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful. Very helpful comment, thank you!

response = getter(params=params)
if stream_records:
for record in self._transform(self.parse_response(response)):
index = next((i for i, item in enumerate(stream_records) if item.get("id") == record.get("id")), -1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we key stream_records in a dict of ID to record? This way we don't need to loop repeatedly e.g:

id_to_record =  dict(map(lambda record: (record["id"],record), stream_records))
for record in self._transform....

It also makes it clearer how we handle the case where a record with a different ID was added

Also, are we guaranteed that all streams have IDs whose name is id?

We should have a LOT of testing around this merging logic because it is super critical -- a mistake here would output incorrect data for a user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for all streams that use the properties parameter there is id for record.

@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 19, 2021

/test connector=connectors/source-google-directory

🕑 connectors/source-google-directory https://github.com/airbytehq/airbyte/actions/runs/1358748596
✅ connectors/source-google-directory https://github.com/airbytehq/airbyte/actions/runs/1358748596
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                       Stmts   Miss  Cover
	 --------------------------------------------------------------
	 base_python/__init__.py                       13      0   100%
	 base_python/catalog_helpers.py                10      6    40%
	 base_python/cdk/__init__.py                    0      0   100%
	 base_python/cdk/abstract_source.py            83     59    29%
	 base_python/cdk/streams/__init__.py            0      0   100%
	 base_python/cdk/streams/auth/__init__.py       0      0   100%
	 base_python/cdk/streams/auth/core.py           8      1    88%
	 base_python/cdk/streams/auth/jwt.py            5      5     0%
	 base_python/cdk/streams/auth/oauth.py         37     26    30%
	 base_python/cdk/streams/auth/token.py          9      4    56%
	 base_python/cdk/streams/core.py               63     32    49%
	 base_python/cdk/streams/exceptions.py         10      2    80%
	 base_python/cdk/streams/http.py               67     33    51%
	 base_python/cdk/streams/rate_limiting.py      30     14    53%
	 base_python/cdk/utils/__init__.py              0      0   100%
	 base_python/cdk/utils/casing.py                4      0   100%
	 base_python/client.py                         56     33    41%
	 base_python/entrypoint.py                     70     56    20%
	 base_python/integration.py                    52     25    52%
	 base_python/logger.py                         33     19    42%
	 base_python/schema_helpers.py                 56     41    27%
	 base_python/source.py                         51     34    33%
	 main_dev.py                                    3      3     0%
	 --------------------------------------------------------------
	 TOTAL                                        660    393    40%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                  Stmts   Miss  Cover
	 ---------------------------------------------------------
	 main_dev.py                               6      6     0%
	 source_google_directory/__init__.py       2      2     0%
	 source_google_directory/api.py           74     74     0%
	 source_google_directory/client.py        24     24     0%
	 source_google_directory/source.py         4      4     0%
	 source_google_directory/utils.py          3      3     0%
	 ---------------------------------------------------------
	 TOTAL                                   113    113     0%

@jrhizor jrhizor temporarily deployed to more-secrets October 19, 2021 10:44 Inactive
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 21, 2021

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1367666417
✅ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1367666417
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                       Stmts   Miss  Cover
	 --------------------------------------------------------------
	 base_python/__init__.py                       13      0   100%
	 base_python/catalog_helpers.py                10      6    40%
	 base_python/cdk/__init__.py                    0      0   100%
	 base_python/cdk/abstract_source.py            83     59    29%
	 base_python/cdk/streams/__init__.py            0      0   100%
	 base_python/cdk/streams/auth/__init__.py       0      0   100%
	 base_python/cdk/streams/auth/core.py           8      1    88%
	 base_python/cdk/streams/auth/jwt.py            5      5     0%
	 base_python/cdk/streams/auth/oauth.py         37     26    30%
	 base_python/cdk/streams/auth/token.py          9      4    56%
	 base_python/cdk/streams/core.py               63     32    49%
	 base_python/cdk/streams/exceptions.py         10      2    80%
	 base_python/cdk/streams/http.py               67     33    51%
	 base_python/cdk/streams/rate_limiting.py      30     14    53%
	 base_python/cdk/utils/__init__.py              0      0   100%
	 base_python/cdk/utils/casing.py                4      0   100%
	 base_python/client.py                         56     33    41%
	 base_python/entrypoint.py                     70     56    20%
	 base_python/integration.py                    52     25    52%
	 base_python/logger.py                         33     19    42%
	 base_python/schema_helpers.py                 56     41    27%
	 base_python/source.py                         51     34    33%
	 main_dev.py                                    3      3     0%
	 --------------------------------------------------------------
	 TOTAL                                        660    393    40%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                         Stmts   Miss  Cover
	 ------------------------------------------------
	 main_dev.py                      6      6     0%
	 source_hubspot/__init__.py       2      0   100%
	 source_hubspot/api.py          399    101    75%
	 source_hubspot/client.py        40     17    58%
	 source_hubspot/errors.py         6      0   100%
	 source_hubspot/source.py         4      0   100%
	 ------------------------------------------------
	 TOTAL                          457    124    73%

@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 21, 2021 11:21 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 21, 2021 11:21 Inactive
@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 21, 2021 11:24 Inactive
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 21, 2021

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1367696311
✅ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1367696311
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                       Stmts   Miss  Cover
	 --------------------------------------------------------------
	 base_python/__init__.py                       13      0   100%
	 base_python/catalog_helpers.py                10      6    40%
	 base_python/cdk/__init__.py                    0      0   100%
	 base_python/cdk/abstract_source.py            83     59    29%
	 base_python/cdk/streams/__init__.py            0      0   100%
	 base_python/cdk/streams/auth/__init__.py       0      0   100%
	 base_python/cdk/streams/auth/core.py           8      1    88%
	 base_python/cdk/streams/auth/jwt.py            5      5     0%
	 base_python/cdk/streams/auth/oauth.py         37     26    30%
	 base_python/cdk/streams/auth/token.py          9      4    56%
	 base_python/cdk/streams/core.py               63     32    49%
	 base_python/cdk/streams/exceptions.py         10      2    80%
	 base_python/cdk/streams/http.py               67     33    51%
	 base_python/cdk/streams/rate_limiting.py      30     14    53%
	 base_python/cdk/utils/__init__.py              0      0   100%
	 base_python/cdk/utils/casing.py                4      0   100%
	 base_python/client.py                         56     33    41%
	 base_python/entrypoint.py                     70     56    20%
	 base_python/integration.py                    52     25    52%
	 base_python/logger.py                         33     19    42%
	 base_python/schema_helpers.py                 56     41    27%
	 base_python/source.py                         51     34    33%
	 main_dev.py                                    3      3     0%
	 --------------------------------------------------------------
	 TOTAL                                        660    393    40%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                         Stmts   Miss  Cover
	 ------------------------------------------------
	 main_dev.py                      6      6     0%
	 source_hubspot/__init__.py       2      0   100%
	 source_hubspot/api.py          405    101    75%
	 source_hubspot/client.py        40     17    58%
	 source_hubspot/errors.py         6      0   100%
	 source_hubspot/source.py         4      0   100%
	 ------------------------------------------------
	 TOTAL                          463    124    73%

@jrhizor jrhizor temporarily deployed to more-secrets October 21, 2021 11:31 Inactive
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

I have one question about why we are changing schemas and the impact users should expect, but otherwise we should be ready to ship

@@ -17,6 +17,8 @@
from base_python.entrypoint import logger
from source_hubspot.errors import HubspotAccessDenied, HubspotInvalidAuth, HubspotRateLimited, HubspotTimeout

PROPERTIES_PARAM_MAX_LENGTH = 15000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful. Very helpful comment, thank you!

@@ -2,67 +2,25 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": ["null", "object"],
"properties": {
"portalId": {
Copy link
Contributor

@sherifnada sherifnada Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we changed so many schemas? were all of these changes schemas previously incorrect? Most importantly: were these fields not being populated before?

The thing I'm trying to verify here is whether a user who has built a workflow based on the output of this connector (e.g: SQL statements or dashboard) will have some breaking changes as a result of this change, or if this is just declaring the data that has always been output

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All but one of the changed schemas were previously incorrect and the schemas did not match the records.
The only moment where I changed the scheme, but it was correct, was Forms Stream. I changed it, since I also changed the URL to get data on it. Before that, we used an outdated URL with version 2 (/forms/v2/form), I updated it to the third version (/marketing/v3/forms), we get the same data, but the format for them is slightly changed. I did this because we refer to the Hubspot documentation, but there is no longer any description for getting forms using the API version 2.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. thanks for the context!

params.update({"properties": ",".join(properties)})
response = getter(params=params)
for record in self._transform(self.parse_response(response)):
if record["id"] not in stream_records:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful, this is really easy to follow now! also simpler than my earlier suggestion ;)

@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 25, 2021 14:54 Inactive
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Oct 26, 2021

/publish connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1385578864
✅ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/1385578864

@yevhenii-ldv yevhenii-ldv temporarily deployed to more-secrets October 26, 2021 12:19 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 26, 2021 12:21 Inactive
@yevhenii-ldv yevhenii-ldv merged commit 928aa62 into master Oct 26, 2021
@yevhenii-ldv yevhenii-ldv deleted the ykurochkin/hubspot-source-issue-with-414-errors branch October 26, 2021 12:37
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
…irbytehq#6954)

* Source Hubspot: Fix issue with getting 414 HTTP error for streams

* update code and schemas

* bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
5 participants