fivetran / dbt_shopify

Fivetran's Shopify dbt package
https://fivetran.github.io/dbt_shopify/
Apache License 2.0
55 stars 41 forks source link

Added: order_line_refunds.order_line_refund_id for shopify__orders__order_refunds.sql #23

Closed lizdeika closed 3 years ago

lizdeika commented 3 years ago

Are you a current Fivetran customer? deividas, smartbrandslaboratory

What change(s) does this PR introduce? Added: order_line_refunds.order_line_refund_id for intermediate/shopify__orders__order_refunds.sql

It is very usefull field to be used later on

Does this PR introduce a breaking change?

Is this PR in response to a previously created Issue

How did you test the PR changes?

- [ ] CircleCi - [x] Other (please provide additional testing details below) **Select which warehouse(s) were used to test the PR** - [ ] BigQuery - [ ] Redshift - [ ] Snowflake - [x] Postgres - [ ] Databricks - [ ] Other (provide details below) **Provide an emoji that best describes your current mood** :dancer: **Feedback** We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.
fivetran-joemarkiewicz commented 3 years ago

Thanks for opening this PR @lizdeika!

Youopened this at the perfect time as I was just about to cut a new release for dbt 0.20.0 compatibility. I see you have added the order_line_refund_id field to the intermediate shopify__orders__order_refunds model. Is your intention that this field will flow into downstream models (ie. shopify__orders or shopify__order_lines)?

With the current change you applied in the PR the order_line_refund_id field will only persist within that intermediate model. Is that the intention, or did you want this field in other models as well?

Thanks!

fivetran-joemarkiewicz commented 3 years ago

@lizdeika In an effort to upgrade to close out the remaining packages with dbt 0.20.0 compatibility I will hold off on merging the PR until we have a stronger understanding of how else we can integrate the new field into the final models.

Let me know if you have any questions, I am looking forward to being able to integrate your suggestions into the following release of dbt_shopify!

lizdeika commented 3 years ago

Hi,

My intention is to build order_returns and order_return_lines in my project. So order_line_refund_id is a needed field for order_return_lines For now I have just copy-pasted intermediate/shopify__orders__order_refunds.sql source to my project's stg_shopify__order_returns_tmp.sql and added order_line_refund_id If this would be merged, I would build my stg_shopify__order_returns_tmp.sql like this:

select *
from {{ ref('shopify__orders__order_refunds') }}
where restock_type = 'return'
fivetran-joemarkiewicz commented 3 years ago

@lizdeika just wanted to give an update that since it is Friday and the end of the day I will want to hold off cutting an official release to the dbt hub until Monday morning when the folks as dbt-labs are back online.

In the meantime, you can use the below config in your packages.yml to use the existing branch and you can follow the activity on this repo to be alerted once the official release is live on the dbt hub!

packages:
    - git: https://github.com/fivetran/dbt_shopify.git
      warn-unpinned: false
fivetran-joemarkiewicz commented 3 years ago

FYI This has been integrated into the latest release of this package. The v0.5.1 version of the package should be live on the dbt hub at the top of the hour.

Please feel open another PR or issue if you have any other questions or requests. Thank you!

lizdeika commented 3 years ago

Thanks! I have updated to 0.5.1 and changed my returns model. All good 👍🏽