fivetran / dbt_shopify_source

Fivetran's Shopify source dbt package
https://fivetran.github.io/dbt_shopify_source/
Apache License 2.0
30 stars 22 forks source link

Consider adding passthrough columns #7

Closed kristin-bagnall closed 3 years ago

kristin-bagnall commented 3 years ago

In some instances, customers use multiple shopify connectors. Our solution is to union all of the data together prior to running the transformation, however there may not be a way to differentiate the different connectors/shops. Users would need to add an additional column to do this, and we would then need to allow customers to pass through these columns to the final models.

Related slack convo: https://getdbt.slack.com/archives/C0VLZPLAE/p1610571493343300

MartinGuindon commented 3 years ago

I'd be happy to work on this and contribute a PR as part of the project I'm working on. I think this should be pretty straightforward to implement. Here's the solution I'm thinking:

vars:
    shopify_passthrough_columns: ["shop_identifier", "shop_url"]

Any thoughts?

kristin-bagnall commented 3 years ago

@MartinGuindon that would be great! A good example of how we've done this in the pass is in our salesforce model.

Once you identify the models you'd like to include passthrough columns to, the steps include the following. I've linked examples of this work for each item.

Source package:

Transform package:

MartinGuindon commented 3 years ago

Cool, pretty much the solution I had in mind, except with a per-model config which makes it even more flexible.