-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from calogica/fix/get-base-dates-datepart
Add support for date parts in get_base_dates
- Loading branch information
Showing
8 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,3 @@ quoting: | |
vars: | ||
'dbt_date:time_zone': 'America/Los_Angeles' | ||
|
||
models: | ||
dbt_date: | ||
example_models: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{ | ||
config( | ||
materialized = "ephemeral" | ||
) | ||
}} | ||
{{ dbt_date.get_date_dimension('2015-01-01', '2022-12-31') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
models/example_models/dim_date_fiscal.sql → integration_tests/models/dim_date_fiscal.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
{{ | ||
config( | ||
materialized = "table" | ||
) | ||
}} | ||
with fp as ( | ||
{{ dbt_date.get_fiscal_periods(ref('dates'), year_end_month=1, week_start_day=1) }} | ||
) | ||
select | ||
f.* | ||
from | ||
fp f | ||
fp f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{ | ||
config( | ||
materialized = "table" | ||
) | ||
}} | ||
with periods_hours as ( | ||
{{ dbt_date.get_base_dates(n_dateparts=24*28, datepart="hour") }} | ||
) | ||
select | ||
d.* | ||
from | ||
periods_hours d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{ | ||
config( | ||
materialized = "table" | ||
) | ||
}} | ||
with periods_weeks as ( | ||
{{ dbt_date.get_base_dates(n_dateparts=52, datepart="week") }} | ||
) | ||
select | ||
d.* | ||
from | ||
periods_weeks d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.