-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🐛 Fix Intercom stream base url in check connection #11176
🐛 Fix Intercom stream base url in check connection #11176
Conversation
@@ -18,7 +18,7 @@ | |||
|
|||
|
|||
class IntercomStream(HttpStream, ABC): | |||
url_base = "https://api.intercom.io/" | |||
url_base = "https://api.intercom.io" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is concatenated with stream paths below to form https://api.intercom.io/<path>
-- is it safe to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reading stream data doesn't matter urljoin
will parse correctly with /
or without.
The problem happens in the check connection function where is concatenating using f-string and not urljoin.
airbyte/airbyte-integrations/connectors/source-intercom/source_intercom/source.py
Lines 416 to 417 in 266a491
url = f"{IntercomStream.url_base}/tags" | |
auth_headers = {"Accept": "application/json", **authenticator.get_auth_header()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sherifnada @marcosmarxm Would you guys prefer it if I change it to a urljoin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be better imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
@mrhallak can you sign the CLA? |
Done! |
/test connector=connectors/source-intercom repo=mrhallak/airbyte |
What
Hello Airbyte team! I was giving the tool a shot and wanted to use Intercom as a source. I noticed the extra slash at the end of the URL through the logs I got because I was not able to connect.
How
The solution is pretty simple - just removing the slash at the end of the base url.
Recommended reading order
python
🚨 User Impact 🚨
There shouldn't be any breaking changes here
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Note some tests failed - it seems the Intercom token I have does not grant me access to everything which is expected because I'm using a token provided by my organization
Acceptance
Results (17.32s):
17 passed
5 failed
- ../airbyte/source_acceptance_test/source_acceptance_test/tests/test_core.py:144 TestConnection.test_check[inputs0]
- ../airbyte/source_acceptance_test/source_acceptance_test/tests/test_core.py:355 TestBasicRead.test_read[inputs0]
- ../airbyte/source_acceptance_test/source_acceptance_test/tests/test_full_refresh.py:39 TestFullRefresh.test_sequential_reads[inputs0]
- ../airbyte/source_acceptance_test/source_acceptance_test/tests/test_incremental.py:81 TestIncremental.test_two_sequential_reads[inputs0]
- ../airbyte/source_acceptance_test/source_acceptance_test/tests/test_incremental.py:105 TestIncremental.test_state_with_abnormally_large_values[inputs0]