-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 Intercom: Update Intercom API to version 2.5 #15681
Conversation
Unit Tests:
|
/test connector=connectors/source-intercom
Build FailedTest summary info:
Build FailedTest summary info:
|
@@ -119,7 +119,9 @@ | |||
} | |||
} | |||
}, | |||
"priority": { | |||
"custom_attributes": { | |||
"type": ["null", "object"] |
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.
Would we want to optionally specify in the connector spec (configuration) the custom JSON Schema for that field though? If left empty, it could default to object.
But if the user is able to describe what kind of data is being recorded there in the source API, then normalization would be able to handle the extra data in a more well-structured manner...
Is that worth exposing to the connector configuration?
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.
The ultimate goal is to bring in in all of the custom_attributes
that are configured in Intercom (similar to how the Salesforce connector works to bring in all custom fields).
The data is stored as "key:value" in Intercom (source), so I don't think we need to allow for JSON in the config since it is relatively simple.
Let me know if I am misunderstanding here though!
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.
Is it possible for you to share an example of a record from intercom that includes data in the "custom_attributes" column?
Here in the test / expected results from this PR, it's left empty:
"custom_attributes": {},
So it's not super insightful on how it'd be presented and used by users afterwards
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.
Yes - we don't have any custom attributes created on our Test Intercom account, so that is why they are empty in the example and integration test.
Here is an example result from the prod Intercom account:
"custom_attributes":{"Needed Escalation":false,"Follow Up Required":false,"Chat Closed Reason":"Alpha Connector Issue"}
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.
It ends up in the database as a json column where you can extract the keys/values as follows:
select
json_extract_scalar(custom_attributes, "$.Needed Escalation") as needed_escalation,
json_extract_scalar(custom_attributes, "$.Follow Up Required") as follow_up_required,
json_extract_scalar(custom_attributes, "$.Chat Closed Reason") as chat_closed_reason
from conversations
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.
yes, so when running the discover
command, if the catalog would be able to contain:
"custom_attributes": {
"type": ["null", "object"]
"properties": {
"Needed Escalation": {
"type": ["null", "string"]
},
"Follow Up Required": {
"type": ["null", "string"]
},
"Chat Closed Reason": {
"type": ["null", "string"]
}
}
}
then normalization would be able to generate the json_extract lines that you linked automatically too
Of course, just having the json column custom_attributes
is already a good move forward already!
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.
The logic for custom_attributes should be applied, we need to nest all keys into "key" and all the value into "value", than modify the json_schema with this change and it will work correctly for all possible key:value pairs custom_attributes holds.
We can do this now or later on, if we move with the change like in this PR - it's totally ok, but there is a right way to do it, so probably we will make it in the future updates.
/test connector=connectors/source-intercom
Build PassedTest summary info:
|
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.
I'm not blocking this PR but I had a question on the json schema for the new field (could be re-worked later too but we'd have to make sure to file an issue for it)
Before merging, it still need to publish and update changelog of the connector btw
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.
LGTM, but the change log should be updated, make sure you've done that.
/publish connector=connectors/source-intercom
if you have connectors that successfully published but failed definition generation, follow step 4 here |
* upgrade intercom API to v2.5 * update conversations schema * update expected records * update change log * fix doc formatting * auto-bump connector version [ci skip] Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
What
Upgrade Intercom API from v2.2 to v2.5
Primary use case is to pull in
custom_attributes
on the Conversation objectCloses #15141
How
Increment API version to 2.5
Update schema.json to include
custom_attributes
🚨 User Impact 🚨
Backwards compatible with earlier API versions
Pre-merge Checklist
Expand the relevant checklist and delete the others.
Updating 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 hereTests
Unit
See below
Integration
See below
Acceptance
See below