Skip to content

Commit

Permalink
Fixed date trunc limiting var for Snowflake which broke when fixing f…
Browse files Browse the repository at this point in the history
…or BQ (#18)

Testing CI jobs, we want both BQ and SF to run here.

---------

Co-authored-by: Winnie Winship <[email protected]>
Co-authored-by: dave-connors-3 <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2024
1 parent 2eec48b commit 11504ae
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clean-targets:
- "dbt_packages"

vars:
truncate_timespan_to: "cast({{ dbt_date.now() }} as datetime)"
truncate_timespan_to: "{{ dbt.cast(dbt.current_timestamp(), 'datetime') }}"
"dbt_date:time_zone": "America/Los_Angeles"

seeds:
Expand Down
2 changes: 2 additions & 0 deletions models/marts/order_items.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ order_items as (
orders as (

select * from {{ ref('stg_orders') }}

),

products as (
Expand All @@ -33,6 +34,7 @@ order_supplies_summary as (
from supplies

group by 1

),

joined as (
Expand Down
3 changes: 0 additions & 3 deletions models/staging/stg_locations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ source as (

select * from {{ source('ecom', 'raw_stores') }}

-- if you generate a larger dataset,
-- you can limit the timespan to the current time with the following line
-- where ordered_at <= {{ var('truncate_timespan_to') }}
),

renamed as (
Expand Down
3 changes: 0 additions & 3 deletions models/staging/stg_orders.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ with
source as (

select * from {{ source('ecom', 'raw_orders') }}
-- if you generate a larger dataset,
-- you can limit the timespan to the current time with the following line
where ordered_at <= {{ var('truncate_timespan_to') }}

),

Expand Down

0 comments on commit 11504ae

Please sign in to comment.