-
Notifications
You must be signed in to change notification settings - Fork 40
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
Bugfix/redshift constant expressions #92
Conversation
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.
@fivetran-reneeli thanks for working through these changes. Please see my change requests and notes below. A number of them reference the source PR so I would recommend reviewing that PR first. Let me know if you have any questions. Thanks!
CHANGELOG.md
Outdated
# dbt_shopify v0.14.0 | ||
|
||
## Under the Hood | ||
- Adds enable config for the upstream `metadata` staging model (`stg_shopify__metafield`). For more information on how to enable/disable this table, refer to the [README](https://github.com/fivetran/dbt_shopify/blob/main/README.md#adding-metafields). |
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.
See my notes from the source, we will need to rethink the approach taken for the metafields.
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 updated the approach and documentation, let me know your thoughts!
CHANGELOG.md
Outdated
|
||
## Under the Hood | ||
- Adds enable config for the upstream `metadata` staging model (`stg_shopify__metafield`). For more information on how to enable/disable this table, refer to the [README](https://github.com/fivetran/dbt_shopify/blob/main/README.md#adding-metafields). | ||
- Adds disable config for the upstream `abandoned_checkout` staging models (including `stg_shopify__abandoned_checkout`, `stg_shopify__abandoned_checkout_discount_code`, and `stg_shopify__abandoned_checkout_shipping_line`). For more information on how to enable/disable these tables, refer to the [README](https://github.com/fivetran/dbt_shopify/blob/main/README.md#step-5-disable-models-for-non-existent-sources). |
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.
See my source PR review note and make the same updates here.
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
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.
yup!
README.md
Outdated
@@ -120,7 +120,18 @@ vars: | |||
shopify_using_fulfillment_event: true # false by default | |||
``` | |||
|
|||
### Step 5: Setting your timezone | |||
### Step 5: Disable models for non-existent sources |
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.
See my note from the source package about consolidating this with the above section
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.
consolidated
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
README.md
Outdated
@@ -172,7 +183,7 @@ vars: | |||
``` | |||
|
|||
#### Adding Metafields | |||
In [May 2021](https://fivetran.com/docs/applications/shopify/changelog#may2021) the Shopify connector included support for the [metafield resource](https://shopify.dev/api/admin-rest/2023-01/resources/metafield). If you would like to take advantage of these metafields, this package offers corresponding mapping models which append these metafields to the respective source object for the following tables: collection, customer, order, product_image, product, product_variant, shop. If enabled, these models will materialize as `shopify__[object]_metafields` for each respective supported object. To enable these metafield mapping models, you may use the following configurations within your `dbt_project.yml`. | |||
In [May 2021](https://fivetran.com/docs/applications/shopify/changelog#may2021) the Shopify connector included support for the [metafield resource](https://shopify.dev/api/admin-rest/2023-01/resources/metafield). If you would like to take advantage of these metafields, this package offers corresponding mapping models which append these metafields to the respective source object for the following tables: collection, customer, order, product_image, product, product_variant, shop. Enabling any of the following variables will materialize the `stg_shopify__metafield` model, in addition to respective models that will materialize as `shopify__[object]_metafields` for each respective supported object. To enable these metafield mapping models, you may use the following configurations within your `dbt_project.yml`. |
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.
See my previous notes about how we should rethink this approach
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
integration_tests/dbt_project.yml
Outdated
shopify_using_fulfillment_event: true | ||
shopify_using_all_metafields: true | ||
shopify__standardized_billing_model_enabled: true | ||
shopify_using_abandoned_checkout: true |
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 this necessary? Isn't it enabled by default 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.
Ah yes it is, removed
integration_tests/dbt_project.yml
Outdated
shopify_using_fulfillment_event: true | ||
shopify_using_all_metafields: true | ||
shopify__standardized_billing_model_enabled: true |
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.
We need to comment these out
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.
commented out
integration_tests/dbt_project.yml
Outdated
@@ -56,7 +57,7 @@ dispatch: | |||
search_order: ['spark_utils', 'dbt_utils'] | |||
|
|||
models: | |||
+schema: "{{ 'shopify_integrations_tests_sqlw' if target.name == 'databricks-sql' else 'shopify' }}" | |||
+schema: "{{ 'shopify_integrations_tests_sqlw' if target.name == 'databricks-sql' else 'shopify_customers_dev' }}" |
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.
Can we change this back?
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.
oops- switched
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
packages.yml
Outdated
# version: [">=0.13.0", "<0.14.0"] | ||
|
||
- git: https://github.com/fivetran/dbt_shopify_source.git | ||
revision: bugfix/redshift_constant_expressions | ||
warn-unpinned: false |
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.
Reminder to swap before release
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.
@fivetran-reneeli great work on this. I have just a few more requests before approval.
CHANGELOG.md
Outdated
- `stg_shopify__abandoned_checkout_discount_code` | ||
- `stg_shopify__abandoned_checkout_shipping_line`. | ||
- For more information on how to enable/disable these tables, refer to the [README](https://github.com/fivetran/dbt_shopify/blob/main/README.md#step-4-disable-models-for-non-existent-sources). | ||
- Updates the `index` calculation in `stg_shopify__abandoned_checkout_discount_code` by removing the conditional logic for null scenarios now that a disable config has been added to the model. |
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 not relevant for the transform model. We can remove this entry.
- Updates the `index` calculation in `stg_shopify__abandoned_checkout_discount_code` by removing the conditional logic for null scenarios now that a disable config has been added to the model. |
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.
Right! Removed
CHANGELOG.md
Outdated
- Adds enable/disable config for the `metadata` staging model using the `shopify_using_metafield` variable (default `true`). | ||
- Adds enable/disable config for the `abandoned_checkout` staging models using the `shopify_using_abandoned_checkout` variable (default `true`): | ||
- `stg_shopify__abandoned_checkout` | ||
- `stg_shopify__abandoned_checkout_discount_code` | ||
- `stg_shopify__abandoned_checkout_shipping_line`. |
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.
We should also callout the downstream impacts of these variables within this package. For example, the metafield variable is now a requirement in the metafield tables and the abandoned checkout variable will turn off relevant information in X end models.
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.
good point,updated
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 with just one small whitespace suggestion in the CHANGELOG
Co-authored-by: Joe Markiewicz <[email protected]>
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.
@fivetran-reneeli a small suggestion but lgtm!
CHANGELOG.md
Outdated
# dbt_shopify v0.14.0 | ||
|
||
[PR #92](https://github.com/fivetran/dbt_shopify/pull/92) includes the following updates: | ||
## Under the Hood |
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.
## Under the Hood | |
## Breaking Changes |
Same here since this could result in schema changes.
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!
PR Overview
This PR will address the following Issue/Feature: v0.14.0
This PR will result in the following new package version:
Breaking, potential changes to the schema
Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:
Under the Hood
metadata
staging model (stg_shopify__metafield
). For more information on how to enable/disable this table, refer to the README.abandoned_checkout
staging models (includingstg_shopify__abandoned_checkout
,stg_shopify__abandoned_checkout_discount_code
, andstg_shopify__abandoned_checkout_shipping_line
). For more information on how to enable/disable these tables, refer to the README.PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please share any and all of your validation steps:
Recreate the constant expressions error in integration_test folder by running on an empty schema ( ex: shopify_schema: empty). If the upstream table is empty, it should be disabled and voided in the downstream compiled code
If you had to summarize this PR in an emoji, which would it be?
💃