���8 �networkx.classes.digraph��DiGraph���)��}�(�graph�}��_node�}�(�(source.jaffle_shop.jaffle_shop.customers�}�(�database��jaffle_shop��schema��main��name�� customers��
resource_type��source��package_name��jaffle_shop��path��models\staging\schema.yml��original_file_path��models\staging\schema.yml�� unique_id�h �fqn�]�(�jaffle_shop��staging��jaffle_shop�� customers�e�source_name��jaffle_shop��source_description��<Raw data from the jaffle shop (using seeds for this example)��loader�� ��
identifier��
raw_customers��quoting�}�� freshness�}�(�
warn_after�}��error_after�}�u�description��Raw customer data��columns�}�(�id�}�(h�id�h0�Primary key for customers��meta�}��constraints�]��config�}�(h8}��tags�]�uh?]��
doc_blocks�]�u�
first_name�}�(h�
first_name�h0�Customer's first name�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u� last_name�}�(h� last_name�h0�Customer's last name�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�uuh8}��source_meta�}�h?]�h<}�(�enabled��h*}�(h,}�h.}�uh8}�h?]�u�unrendered_config�}�(�loaded_at_field�N�loaded_at_query�Nh8}�h?]�u�
relation_name��$"jaffle_shop"."main"."raw_customers"��
created_at�GA�Y������unrendered_schema��main�hB]��
_event_status�}�u�%source.jaffle_shop.jaffle_shop.orders�}�(h�jaffle_shop�h
�main�h�orders�hhh�jaffle_shop�h�models\staging\schema.yml�h�models\staging\schema.yml�hhsh]�(�jaffle_shop��staging��jaffle_shop��orders�eh �jaffle_shop�h"�<Raw data from the jaffle shop (using seeds for this example)�h$h%h&�
raw_orders�h(}�h*}�(h,}�h.}�uh0�Raw order data�h2}�(h4}�(h�id�h0�Primary key for orders�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u�user_id�}�(h�user_id�h0�Foreign key to customers�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u�
order_date�}�(h�
order_date�h0�Date the order was placed�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u�status�}�(h�status�h0�&Order status (completed, shipped, etc)�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�uuh8}�h[}�h?]�h<}�(h_�h*}�(h,}�h.}�uh8}�h?]�uhe}�(hgNhhNh8}�h?]�uhk�!"jaffle_shop"."main"."raw_orders"�hmGA�Y���1Mhn�main�hB]�hq}�u�model.jaffle_shop.customers�}�(h�jaffle_shop�h
�main�h� customers�h�model�h�jaffle_shop�h�marts\customers.sql�h�models\marts\customers.sql�hh�h]�(�jaffle_shop��marts�� customers�e�alias�� customers��checksum�}�(h�sha256�hӌ@57e134bd61b3b2bf6ad8260a128d91bc496ec5bb0afc8a9d009101be79ec1d50�uh<}�(h_�h?]�h8}��materialized��view��lookback�K�persist_docs�}�� post-hook�]��pre-hook�]�h(}��column_types�}��on_schema_change��ignore��on_configuration_change��apply��grants�}��packages�]��docs�}��show��s�contract�}�(�enforced���alias_types��u�access�� protected�uh?]�h0�+Final customer dimension with order metrics�h2}�(�customer_id�}�(h�customer_id�h0�Primary key for customers�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�uhD}�(h�
first_name�h0�Customer's first name�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�uhO}�(h� last_name�h0�Customer's last name�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u�first_order_date�}�(h�first_order_date�h0�"Date of the customer's first order�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u�most_recent_order_date�}�(h�most_recent_order_date�h0�(Date of the customer's most recent order�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�u�number_of_orders�}�(h�number_of_orders�h0�.Total number of orders placed by this customer�h8}�h:]�h<}�(h8}�h?]�uh?]�hB]�uuh8}�h�}�h��s�
patch_path��%jaffle_shop://models\marts\schema.yml�he}�hmGA�Y��u�o�config_call_dict�}��unrendered_config_call_dict�}�hk� "jaffle_shop"."main"."customers"��raw_code�Xg with customers as (
select * from {{ ref('stg_customers') }}
),
orders as (
select * from {{ ref('stg_orders') }}
),
-- TESTING: Step 1 - before parse, run, parse sequence
customer_orders as (
select
customer_id,
min(order_date) as first_order_date,
max(order_date) as most_recent_order_date,
count(order_id) as number_of_orders
from orders
group by customer_id
),
final as (
select
customers.customer_id,
customers.first_name,
customers.last_name,
customer_orders.first_order_date,
customer_orders.most_recent_order_date,
coalesce(customer_orders.number_of_orders, 0) as number_of_orders
from customers
left join
customer_orders
on customers.customer_id = customer_orders.customer_id
)
select * from final�hB]��language��sql��refs�]�(}�h�
stg_customers�s}�h�
stg_orders�se�sources�]��metrics�]��
depends_on�}�(�macros�]��nodes�]�(�model.jaffle_shop.stg_customers��model.jaffle_shop.stg_orders�euh�}�(h�h�uh�h�h:]��primary_key�]��customer_id�au�model.jaffle_shop.stg_customers�}�(h�jaffle_shop�h
�main�h�
stg_customers�hh�h�jaffle_shop�h�staging\stg_customers.sql�h� models\staging\stg_customers.sql�hj` h]�(�jaffle_shop��staging��
stg_customers�ehь
stg_customers�h�}�(h�sha256�hӌ@24ed0d63c02ad1f2112afeeac032485d16e3ec20e2bd4448639a3840264088c0�uh<}�(h_�h?]�h8}�hڌview�h�Kh�}�h�]�h�]�h(}�h�}�h�ignore�h�h�h�}�h�]�h�}�h��sh�}�(h�h�uh�h�uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��WDoj? }�jA }�hk�$"jaffle_shop"."main"."stg_customers"�jD ��with source as (
select * from {{ source('jaffle_shop', 'customers') }}
),
renamed as (
select
id as customer_id,
first_name,
last_name
from source
)
select * from renamed�hB]�jG �sql�jI ]�jO ]�]�(�jaffle_shop�� customers�eajQ ]�jS }�(jU ]�jW ]��(source.jaffle_shop.jaffle_shop.customers�auh�}�(h�h�uh�h�h:]�j] ]�u�model.jaffle_shop.stg_orders�}�(h�jaffle_shop�h
�main�h�
stg_orders�hh�h�jaffle_shop�h�staging\stg_orders.sql�h�models\staging\stg_orders.sql�hj� h]�(�jaffle_shop��staging��
stg_orders�ehь
stg_orders�h�}�(h�sha256�hӌ@fdd0c2fd8f271d1cf451b9c1aaf95163fd40e8d1e29d47ed10796d68d6bab5ef�uh<}�(h_�h?]�h8}�hڌview�h�Kh�}�h�]�h�]�h(}�h�}�h�ignore�h�h�h�}�h�]�h�}�h��sh�}�(h�h�uh�h�uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��WDoj? }�jA }�hk�!"jaffle_shop"."main"."stg_orders"�jD ��with source as (
select * from {{ source('jaffle_shop', 'orders') }}
),
renamed as (
select
id as order_id,
user_id as customer_id,
order_date,
status
from source
)
select * from renamed�hB]�jG �sql�jI ]�jO ]�]�(�jaffle_shop��orders�eajQ ]�jS }�(jU ]�jW ]��%source.jaffle_shop.jaffle_shop.orders�auh�}�(h�h�uh�h�h:]�j] ]�u�'snapshot.jaffle_shop.customers_snapshot�}�(h�jaffle_shop�h
� snapshots�h�customers_snapshot�h�snapshot�h�jaffle_shop�h�customers_snapshot.sql�h� snapshots\customers_snapshot.sql�hj� h]�(�jaffle_shop��customers_snapshot��customers_snapshot�ehьcustomers_snapshot�h�}�(h�sha256�hӌ@3299b53299a144f1b097a026ac70a3e1e28d9ddd1a1b7ff2ebcbbc6aef535bee�uh<}�(h_�h?]�h8}�hڌsnapshot�h�Kh�}�� post-hook�]��pre-hook�]�h(}�h�}��
unique_key��customer_id�h�ignore�h�h�h�}�h�]�h�}�h��sh�}�(h�h�u�strategy��check��
target_schema�� snapshots��
check_cols�]�(�
first_name�� last_name�e�snapshot_meta_column_names�}�uh?]�h0h%h2}�h8}�h�}�h��she}�(j� � snapshots�j� �customer_id�j� �check�j� ]�(�
first_name�� last_name�euhmGA�Y��d�j? }�(j� � snapshots�j� �customer_id�j� �check�j� ]�(�
first_name�� last_name�eujA }�hk�."jaffle_shop"."snapshots"."customers_snapshot"�jD X
{{
config(
target_schema='snapshots',
unique_key='customer_id',
strategy='check',
check_cols=['first_name', 'last_name']
)
}}
select
customer_id,
first_name,
last_name
from {{ ref('stg_customers') }}
�hB]�jG �sql�jI ]�}�h�
stg_customers�sajO ]�jQ ]�jS }�(jU ]�jW ]��model.jaffle_shop.stg_customers�auh�}�(h�h�uu�seed.jaffle_shop.raw_customers�}�(h�jaffle_shop�h
�main�h�
raw_customers�h�seed�h�jaffle_shop�h�raw_customers.csv�h�seeds\raw_customers.csv�hj h]�(�jaffle_shop��
raw_customers�ehь
raw_customers�h�}�(h�sha256�hӌ@4d6d3f1fae7aa476e1d99e6f7702a4ed9ac936ff3a025e32d5bbb6f18221490e�uh<}�(h_�h?]�h8}�hڌseed�h�Kh�}�� post-hook�]��pre-hook�]�h(}�h�}�h�ignore�h�h�h�}�h�]�h�}�h��sh�}�(h�h�u� delimiter��,�uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��negj? }�jA }�hk�$"jaffle_shop"."main"."raw_customers"�jD h%hB]�� root_path��7C:\Development\github\dbt-core-mcp\examples\jaffle_shop�jS }�jU ]�su�seed.jaffle_shop.raw_orders�}�(h�jaffle_shop�h
�main�h�
raw_orders�hj h�jaffle_shop�h�raw_orders.csv�h�seeds\raw_orders.csv�hjI h]�(�jaffle_shop��
raw_orders�ehь
raw_orders�h�}�(h�sha256�hӌ@756d404f5e681ebb6ffb0d5c77d3c861c730de31e9c07b77c9beb322459b2566�uh<}�(h_�h?]�h8}�hڌseed�h�Kh�}�j/ ]�j1 ]�h(}�h�}�h�ignore�h�h�h�}�h�]�h�}�h��sh�}�(h�h�uj: j; uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��n�_j? }�jA }�hk�!"jaffle_shop"."main"."raw_orders"�jD h%hB]�jE �7C:\Development\github\dbt-core-mcp\examples\jaffle_shop�jS }�jU ]�su�8test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1�}�(h�jaffle_shop�h
�main_dbt_test__audit�h�unique_customers_customer_id�h�test�h�jaffle_shop�h� unique_customers_customer_id.sql�h�models\marts\schema.yml�hjr h]�(�jaffle_shop��marts��unique_customers_customer_id�ehьunique_customers_customer_id�h�}�(h�none�h�h%uh<}�(h_�h
�dbt_test__audit�h?]�h8}�hڌtest��severity��ERROR�� fail_calc��count(*)��warn_if��!= 0��error_if��!= 0�uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��|Xj? }�jA }�jD �-{{ test_unique(**_dbt_generic_test_kwargs) }}�hB]�jG �sql�jI ]�}�h� customers�sajO ]�jQ ]�jS }�(jU ]��macro.dbt.test_unique�ajW ]��model.jaffle_shop.customers�auh�}�(h�h�u�column_name��customer_id��
file_key_name��models.customers��
attached_node��model.jaffle_shop.customers��
test_metadata�}�(h�unique��kwargs�}�(j� �customer_id�hɌ*{{ get_where_subquery(ref('customers')) }}�uuu�:test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d�}�(h�jaffle_shop�h
�main_dbt_test__audit�h�not_null_customers_customer_id�hjw h�jaffle_shop�h�"not_null_customers_customer_id.sql�h�models\marts\schema.yml�hj� h]�(�jaffle_shop��marts��not_null_customers_customer_id�ehьnot_null_customers_customer_id�h�}�(h�none�h�h%uh<}�(h_�h
�dbt_test__audit�h?]�h8}�hڌtest�j� �ERROR�j� �count(*)�j� �!= 0�j� �!= 0�uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��|nj? }�jA }�jD �/{{ test_not_null(**_dbt_generic_test_kwargs) }}�hB]�jG �sql�jI ]�}�h� customers�sajO ]�jQ ]�jS }�(jU ]��macro.dbt.test_not_null�ajW ]��model.jaffle_shop.customers�auh�}�(h�h�uj� �customer_id�j� �models.customers�j� �model.jaffle_shop.customers�j� }�(h�not_null�j� }�(j� �customer_id�hɌ*{{ get_where_subquery(ref('customers')) }}�uuu�?test.jaffle_shop.not_null_customers_number_of_orders.a146fc486b�}�(h�jaffle_shop�h
�main_dbt_test__audit�h�#not_null_customers_number_of_orders�hjw h�jaffle_shop�h�'not_null_customers_number_of_orders.sql�h�models\marts\schema.yml�hj� h]�(�jaffle_shop��marts��#not_null_customers_number_of_orders�ehь#not_null_customers_number_of_orders�h�}�(h�none�h�h%uh<}�(h_�h
�dbt_test__audit�h?]�h8}�hڌtest�j� �ERROR�j� �count(*)�j� �!= 0�j� �!= 0�uh?]�h0h%h2}�h8}�h�}�h��she}�hmGA�Y��|��j? }�jA }�jD �/{{ test_not_null(**_dbt_generic_test_kwargs) }}�hB]�jG �sql�jI ]�}�h� customers�sajO ]�jQ ]�jS }�(jU ]��macro.dbt.test_not_null�ajW ]��model.jaffle_shop.customers�auh�}�(h�h�uj� �number_of_orders�j� �models.customers�j� �model.jaffle_shop.customers�j� }�(h�not_null�j� }�(j� �number_of_orders�hɌ*{{ get_where_subquery(ref('customers')) }}�uuu�?unit_test.jaffle_shop.customers.test_customer_order_aggregation�}�(hɌ customers��given�]�(}�(�input��ref('stg_customers')��rows�]�(}�(h�KhD�Alice�hO�Smith�u}�(h�KhD�Bob�hO�Jones�ue�format��dict�u}�(j! �ref('stg_orders')�j# ]�(}�(�order_id�Keh�Kh��
2024-01-01�u}�(j1 Kfh�Kh��
2024-01-15�u}�(j1 Kgh�Kh��
2024-02-01�uej+ j, ue�expect�}�(j# ]�(}�(h�KhD�Alice�hO�Smith�j �
2024-01-01�j$ �
2024-02-01�j/ Ku}�(h�KhD�Bob�hO�Jones�j Nj$ Nj/ K uej+ j, uh�test_customer_order_aggregation�h� unit_test�h�jaffle_shop�h�marts\customers_unit_tests.yml�h�)unit_tests\marts\customers_unit_tests.yml�hj h]�(�jaffle_shop��marts�� customers��test_customer_order_aggregation�eh0�>Verify customers with multiple orders are aggregated correctly�jS }�(jU ]�jW ]��model.jaffle_shop.customers�auh<}�(h?]�h8}�h_�uhӌ@1b773d8056aae5d06719cd21e9cede56fe52175427b889e27dedd2b321095140�h
�main�hmGA�Y��r/ahq}�u�<unit_test.jaffle_shop.customers.test_customer_with_no_orders�}�(hɌ customers�j ]�(}�(j! �ref('stg_customers')�j# ]�}�(h�KchD�New�hO�Customer�uaj+ j, u}�(j! �ref('stg_orders')�j# ]�j+ j, uej7 }�(j# ]�}�(h�KchD�New�hO�Customer�j Nj$ Nj/ K uaj+ j, uh�test_customer_with_no_orders�hjC h�jaffle_shop�h�marts\customers_unit_tests.yml�h�)unit_tests\marts\customers_unit_tests.yml�hjW h]�(�jaffle_shop��marts�� customers��test_customer_with_no_orders�eh0�5Verify customer with no orders gets 0 count, not null�jS }�(jU ]�jW ]��model.jaffle_shop.customers�auh<}�(h?]�h8}�h_�uhӌ@1e5d13e85d4e0a7957bca970f0181ac1a2063438d1d6cb3ab5a657dc96e9d2e7�h
�main�hmGA�Y��rH7hq}�u�?unit_test.jaffle_shop.customers.test_customer_with_single_order�}�(hɌ customers�j ]�(}�(j! �ref('stg_customers')�j# ]�}�(h�K2hD�Emma�hO�Wilson�uaj+ j, u}�(j! �ref('stg_orders')�j# ]�}�(j1 Kdh�K2h��
2024-01-15�h�� completed�uaj+ j, uej7 }�(j# ]�}�(h�K2hD�Emma�hO�Wilson�j �
2024-01-15�j$ �
2024-01-15�j/ Kuaj+ j, uh�test_customer_with_single_order�hjC h�jaffle_shop�h�marts\customers_unit_tests.yml�h�)unit_tests\marts\customers_unit_tests.yml�hj} h]�(�jaffle_shop��marts�� customers��test_customer_with_single_order�eh0�?Verify first and most recent order dates match for single order�jS }�(jU ]�jW ]��model.jaffle_shop.customers�auh<}�(h?]�h8}�h_�uhӌ@039581d2e3173ba9fed0729ff3625e3b9e582e5fac1b465c4ea433465d4883d4�h
�main�hmGA�Y��r�dhq}�uu�_adj�}�(h }�j` }�shs}�j� }�sh�}�(jr }�j� }�j� }�j }�jW }�j} }�uj` }�(h�}�j� }�uj� }�h�}�sj� }�j }�jI }�jr }�j� }�j� }�j }�jW }�j} }�u�_succ�j� �_pred�}�(h }�hs}�h�}�(j` j� j� j� uj` }�h j� sj� }�hsj� sj� }�j` j� sj }�jI }�jr }�h�j� sj� }�h�j� sj� }�h�j� sj }�h�j� sjW }�h�j� sj} }�h�j� su�__networkx_cache__�}�ub.