Skip to content

Commit

Permalink
Merge pull request #69 from fivetran/bugfix/metafield-casing
Browse files Browse the repository at this point in the history
Add lower casing in stg_shopify__metafield fields to avoid metafield errors
  • Loading branch information
fivetran-avinash authored Jun 26, 2023
2 parents 008a2c9 + 3724c5e commit 503893f
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 15 deletions.
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# dbt_shopify_source v0.UPDATE.UPDATE
# dbt_shopify_source v0.8.3

## Under the Hood:
## Bug Fixes 🐛 🪛
[PR #69](https://github.com/fivetran/dbt_shopify_source/pull/69) includes the following fixes:
- Lower casing `metafield_reference` field in `stg_shopify__metafield` to fix metafield table breakages upstream when the `key` field has different casing for otherwise identical strings.
- Lower casing `owner_resource` field in `stg_shopify__metafield` to ensure identical `value` fields with different casing are then correctly pivoted together upstream in the shopify transformation package `get_metafields` macro.

## Contributors
- [@ZCrookston](https://github.com/ZCrookston) & [@FridayPush](https://github.com/FridayPush) ([Issue #64](https://github.com/fivetran/dbt_shopify_source/issues/64))

- Incorporated the new `fivetran_utils.drop_schemas_automation` macro into the end of each Buildkite integration test job.
- Updated the pull request [templates](/.github).
## Under the Hood:
- Incorporated the new `fivetran_utils.drop_schemas_automation` macro into the end of each Buildkite integration test job. ([PR #65](https://github.com/fivetran/dbt_shopify_source/pull/65/files))
- Updated the pull request [templates](/.github). ([PR #65](https://github.com/fivetran/dbt_shopify_source/pull/65/files))

# dbt_shopify_source v0.8.2

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'shopify_source'
version: '0.8.2'
version: '0.8.3'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions integration_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target/
dbt_modules/
logs/
env/
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'shopify_source_integration_tests'
version: '0.8.2'
version: '0.8.3'
profile: 'integration_tests'
config-version: 2

Expand Down
4 changes: 2 additions & 2 deletions models/stg_shopify__metafield.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ final as (
value,
lower(coalesce(type, value_type)) as value_type,
owner_id as owner_resource_id,
owner_resource,
lower(owner_resource) as owner_resource,
{{ dbt_date.convert_timezone(column='cast(created_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as created_at,
{{ dbt_date.convert_timezone(column='cast(updated_at as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as updated_at,
{{ dbt_date.convert_timezone(column='cast(_fivetran_synced as ' ~ dbt.type_timestamp() ~ ')', target_tz=var('shopify_timezone', "UTC"), source_tz="UTC") }} as _fivetran_synced,
{{ dbt.concat(["namespace","'_'","key"]) }} as metafield_reference,
lower({{ dbt.concat(["namespace","'_'","key"]) }}) as metafield_reference,
row_number() over (partition by id order by updated_at desc) = 1 as is_most_recent_record,
source_relation

Expand Down

0 comments on commit 503893f

Please sign in to comment.