Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

shopify__discounts table skipped casuses downstream models to be skipped #102

@drago-ssh

Description

@drago-ssh

Hi,

After talking to Mriganka he suggested I raise a blank issue here to see if we can solve it.

Problem
I have updated our shopify fivetrann dbt package from 0.13 to 0.19.
When doing the dbt build I notice that I get some skipped models. I would like to make sure that everything builds as before.

Image Image

The logs don't quite say why it was skipped so I'm left wondering.

I also notice some tests failing, specifically these 2:

Image

For the not null test I get this error:
12:32:07 Began running node test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b
12:32:07 559 of 1059 START test not_null_stg_shopify__media_image_image_id .............. [RUN]
12:32:07 Began compiling node test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b
12:32:07 Writing injected SQL for node "test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b"
12:32:07 Began executing node test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b
12:32:07 Writing runtime sql for node "test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b"
12:32:07 On test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b: /* {"app": "dbt", "dbt_version": "2025.6.25+dd77c38", "profile_name": "user", "target_name": "default", "node_id": "test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b"} */

select
  count(*) as failures,
  count(*) != 0 as should_warn,
  count(*) != 0 as should_error
from (

select image_id
from rokoko-dw.dbt_dc_stg_shopify.stg_shopify__media_image
where image_id is null

) dbt_internal_test

12:32:07 Opening a new connection, currently in state closed
12:32:08 BigQuery adapter: https://console.cloud.google.com/bigquery?project=rokoko-dw&j=bq:EU:15ca1972-1097-4996-bb94-8c1cd2f2ed14&page=queryresults
12:32:08 559 of 1059 FAIL 275 not_null_stg_shopify__media_image_image_id ................ [�[31mFAIL 275�[0m in 1.51s]
12:32:08 Finished running node test.shopify_source.not_null_stg_shopify__media_image_image_id.a62b445b8b
12:37:15 �[31mFailure in test not_null_stg_shopify__media_image_image_id (models/stg_shopify.yml)�[0m
12:37:15 Got 275 results, configured to fail if != 0
12:37:15 compiled code at target/compiled/shopify_source/models/stg_shopify.yml/not_null_stg_shopify__media_image_image_id.sql

For the unique combination test I get:

12:33:15 Began running node test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091
12:33:15 810 of 1059 START test dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation [RUN]
12:33:15 Began compiling node test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091
12:33:15 Writing injected SQL for node "test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091"
12:33:15 Began executing node test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091
12:33:15 Writing runtime sql for node "test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091"
12:33:15 On test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091: /* {"app": "dbt", "dbt_version": "2025.6.25+dd77c38", "profile_name": "user", "target_name": "default", "node_id": "test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091"} */

select
  count(*) as failures,
  count(*) != 0 as should_warn,
  count(*) != 0 as should_error
from (

with __dbt__cte__int_shopify__discount_code_enriched as (
with discount_redeem_codes as (

select *
from `rokoko-dw`.`dbt_dc_stg_shopify`.`stg_shopify__discount_redeem_code`

),

discount_applications as (

select *
from `rokoko-dw`.`dbt_dc_stg_shopify`.`stg_shopify__discount_application`

),

unified_discount_codes as (

select
    discount_code_id,
    'basic' as discount_type,
    applies_once_per_customer,
    usage_count,
    codes_count,
    codes_precision,
    combines_with_order_discounts,
    combines_with_product_discounts,
    combines_with_shipping_discounts,
    created_at,
    customer_selection_all_customers,
    ends_at, 
    starts_at,
    status,
    title,
    total_sales_amount,
    total_sales_currency_code,
    updated_at,
    usage_limit,
    source_relation
from `rokoko-dw`.`dbt_dc_stg_shopify`.`stg_shopify__discount_code_basic`

union all

select
    discount_code_id,
    'bxgy' as discount_type, 
    applies_once_per_customer,
    usage_count,
    codes_count,
    codes_precision,
    combines_with_order_discounts,
    combines_with_product_discounts,
    combines_with_shipping_discounts,
    created_at,
    customer_selection_all_customers,
    ends_at,
    starts_at,
    status,
    title,
    total_sales_amount,
    total_sales_currency_code,
    updated_at,
    usage_limit,
    source_relation
from `rokoko-dw`.`dbt_dc_stg_shopify`.`stg_shopify__discount_code_bxgy`

union all

select
    discount_code_id,
    'free_shipping' as discount_type, 
    applies_once_per_customer,
    usage_count,
    codes_count,
    codes_precision,
    combines_with_order_discounts,
    combines_with_product_discounts,
    combines_with_shipping_discounts,
    created_at,
    customer_selection_all_customers,
    ends_at, 
    starts_at,
    status,
    title,
    total_sales_amount,
    total_sales_currency_code,
    updated_at,
    usage_limit,
    source_relation
from `rokoko-dw`.`dbt_dc_stg_shopify`.`stg_shopify__discount_code_free_shipping`

),

discounts_with_codes as (

select
    discount_redeem_codes.code,
    unified_discount_codes.*
from unified_discount_codes 
left join discount_redeem_codes 
    on unified_discount_codes.discount_code_id = discount_redeem_codes.discount_id
    and unified_discount_codes.source_relation = discount_redeem_codes.source_relation

),

discounts_with_applications as (

select
    discounts_with_codes.*,
    discount_applications.allocation_method,
    discount_applications.description,
    discount_applications.target_selection,
    discount_applications.target_type,
    discount_applications.type as application_type,
    discount_applications.value,
    discount_applications.value_type
from discounts_with_codes
left join discount_applications 
    on discounts_with_codes.code = discount_applications.code
    and discounts_with_codes.source_relation = discount_applications.source_relation

)

select *
from discounts_with_applications
), validation_errors as (

select
    code, source_relation
from __dbt__cte__int_shopify__discount_code_enriched
group by code, source_relation
having count(*) > 1

)

select *
from validation_errors

) dbt_internal_test

12:33:15 Opening a new connection, currently in state closed
12:33:17 BigQuery adapter: https://console.cloud.google.com/bigquery?project=rokoko-dw&j=bq:EU:bc79f7c1-c751-4d05-889c-c26999c9b3bd&page=queryresults
12:33:17 810 of 1059 FAIL 4 dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation [�[31mFAIL 4�[0m in 2.16s]
12:33:17 Finished running node test.shopify.dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation.43df67b091
12:37:15 �[31mFailure in test dbt_utils_unique_combination_of_columns_int_shopify__discount_code_enriched_code__source_relation (models/intermediate/intermediate.yml)�[0m
12:37:15 Got 4 results, configured to fail if != 0
12:37:15 compiled code at target/compiled/shopify/models/intermediate/intermediate.yml/dbt_utils_unique_combination_o_5368aaf9111a76f0f2253a79922522a8.sql

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions