[Example] Zendesk Support Airbyte dbt Package #43
marcosmarxm
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This tutorial shows how to create and validate the transformation layer to make Airbyte data compatible with Fivetran dbt package.
Resources:
an example of how the Zendesk Support dbt package was created to ensure compatibility with the Fivetran Modeling dbt Package. The task is challenging, but it can be easily achieved by following some steps.
Airbyte and Fivetran connectors, in general, read data from the API endpoints. The output data can be different as each provider can apply different methodologies. Here is some examples of what can be different:
users
,tickets
) and Fivetran always use in singular (user
,ticket
).Step 1: Identify what streams
First go to the Intermediate dbt Package and access the
models/
folder.Here you can check the
src_<source>.yaml
and see all tables or go into each SQL file to check what stream they're using.You must compare if the streams used here are available in Airbyte (check Airbyte schema or the
connectors/source_zendesk_support/models/source/<stream>.yml
files.Important
Fivetran sometimes created tables for nested objects. One example from Amplitude was Airbyte has only
events
and Fivetran usesevent
andevent_type
this means they have a table generated from a objecttype
inside ofevent
table.ticket_audits
As you can see there are a couple of tables doesn't exist in Airbyte side. This happens because there are some endpoints only accessible for Zendesk Enterprise customers.
It isn't a problem in most situations as we can disable the models for this case, check here as example.
The only problem here is the
ticket_field_history
this table is generated by Fivetran from theticket_audits
.For this case we must generate a transformation to create the table for Airbyte.
In the end the basic Fivetran model uses couple of tables: brand, group, organization, ticket, ticket_comment, ticket_field_history, users and user_fields.
In the future if Airbyte got access to enterprise endpoints or users can contribute to make the model more complete.
After finishing this phase, post your findings in the Issue to get approval for Step 2.
Warning
Step 2: Identify what column each stream is using
Fivetran creates staging models and later create the analytical models based on these intermediate tables.
The critical part of this task is make Airbyte compatible with these intermediate models.
For this step you must go to Fivetran Intermediate dbt Package (find the one for the source you're working) and access the
models/
folder.Inside the
models/
folder it will contain mostly SQL files querying tables are generated by the connector.You must identify if the Airbyte connector has all tables used by the model and for each table it has all columns.
Example 1 when things go all right no changes needed
user
tableThis are all the columns used by Fivetran for the user. Now let's check if Airbyte has the same ones:
airbyte-dbt-models/connectors/source_zendesk_support/models/source/users.yaml
Lines 10 to 128 in acc1186
Comparing both of them you can see Airbyte has all the columns and the column have the same name.
Example 2: column names are different what to do?
It didn't happen for Zendesk, let's use Asana as example.
User table:
Airbyte names
id
asgid
the definition declared by Asana, Fivetran converts it toid
airbyte-dbt-models/connectors/source_asana/models/source/users.yaml
Lines 10 to 14 in acc1186
What to do?
From here you can start running
dbt run
to validate if your model is working as expected.Important
Submit your pull request for each table you're working on, let's do step by step :)
Step 3: Write instructions
You can copy Zendesk README and edit to your connector.
Beta Was this translation helpful? Give feedback.
All reactions