Skip to content

Commit

Permalink
Rename to dow and doy
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Sep 12, 2023
1 parent 16adef7 commit b146895
Show file tree
Hide file tree
Showing 116 changed files with 6,515 additions and 6,515 deletions.
6 changes: 3 additions & 3 deletions metricflow/test/integration/test_cases/itest_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,13 +1062,13 @@ integration_test:
description: Test query using multiple date_parts
model: SIMPLE_MODEL
metrics: ["bookings"]
group_bys: ["metric_time__extract_quarter", "metric_time__extract_dayofweek", "metric_time__extract_dayofyear", "metric_time__extract_day", "metric_time__extract_week"]
group_bys: ["metric_time__extract_quarter", "metric_time__extract_dow", "metric_time__extract_doy", "metric_time__extract_day", "metric_time__extract_week"]
check_query: |
SELECT
SUM(1) AS bookings
, {{ render_extract("ds", DatePart.QUARTER) }} AS metric_time__extract_quarter
, {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dayofweek
, {{ render_extract("ds", DatePart.DAYOFYEAR) }} AS metric_time__extract_dayofyear
, {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dow
, {{ render_extract("ds", DatePart.DAYOFYEAR) }} AS metric_time__extract_doy
, {{ render_extract("ds", DatePart.DAY) }} AS metric_time__extract_day
, {{ render_extract("ds", DatePart.WEEK) }} AS metric_time__extract_week
FROM {{ source_schema }}.fct_bookings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SELECT
, EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month
, EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week
, EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day
, EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow
, EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy
, revenue_src_10006.created_at AS company__ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month
Expand All @@ -23,8 +23,8 @@ SELECT
, EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month
, EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week
, EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day
, EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow
, EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy
, revenue_src_10006.user_id AS user
, revenue_src_10006.user_id AS company__user
FROM ***************************.fct_revenue revenue_src_10006
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SELECT
, EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month
, EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week
, EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month
Expand All @@ -23,8 +23,8 @@ SELECT
, EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month
, EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week
, EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy
, id_verifications_src_10003.verification_type
, id_verifications_src_10003.ds AS verification__ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week
Expand All @@ -36,8 +36,8 @@ SELECT
, EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month
, EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week
, EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month
Expand All @@ -48,8 +48,8 @@ SELECT
, EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month
, EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week
, EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow
, EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy
, id_verifications_src_10003.verification_type AS verification__verification_type
, id_verifications_src_10003.verification_id AS verification
, id_verifications_src_10003.user_id AS user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SELECT
, EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month
, EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week
, EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day
, EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dow
, EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_doy
, users_latest_src_10008.home_state_latest
, users_latest_src_10008.ds AS user__ds__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week
Expand All @@ -23,8 +23,8 @@ SELECT
, EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month
, EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week
, EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day
, EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek
, EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear
, EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dow
, EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_doy
, users_latest_src_10008.home_state_latest AS user__home_state_latest
, users_latest_src_10008.user_id AS user
FROM ***************************.dim_users_latest users_latest_src_10008
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,20 @@
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAY: 'day'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = -->
<!-- {'class': 'TimeDimensionSpec', -->
<!-- 'element_name': 'ds_partitioned', -->
<!-- 'entity_links': (), -->
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAYOFWEEK: 'dayofweek'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = -->
<!-- {'class': 'TimeDimensionSpec', -->
<!-- 'element_name': 'ds_partitioned', -->
<!-- 'entity_links': (), -->
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAYOFYEAR: 'dayofyear'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = -->
<!-- {'class': 'TimeDimensionSpec', -->
<!-- 'element_name': 'ds_partitioned', -->
<!-- 'entity_links': (), -->
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAYOFWEEK: 'dow'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = -->
<!-- {'class': 'TimeDimensionSpec', -->
<!-- 'element_name': 'ds_partitioned', -->
<!-- 'entity_links': (), -->
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAYOFYEAR: 'doy'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = -->
<!-- {'class': 'TimeDimensionSpec', -->
<!-- 'element_name': 'ds_partitioned', -->
Expand Down Expand Up @@ -342,14 +342,14 @@
<!-- 'element_name': 'ds_partitioned', -->
<!-- 'entity_links': ({'class': 'EntityReference', 'element_name': 'customer_id'},), -->
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAYOFWEEK: 'dayofweek'>, -->
<!-- 'date_part': <DatePart.DAYOFWEEK: 'dow'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = -->
<!-- {'class': 'TimeDimensionSpec', -->
<!-- 'element_name': 'ds_partitioned', -->
<!-- 'entity_links': ({'class': 'EntityReference', 'element_name': 'customer_id'},), -->
<!-- 'time_granularity': TimeGranularity.DAY, -->
<!-- 'date_part': <DatePart.DAYOFYEAR: 'dayofyear'>, -->
<!-- 'date_part': <DatePart.DAYOFYEAR: 'doy'>, -->
<!-- 'aggregation_state': None} -->
<!-- include_spec = EntitySpec(element_name='customer_id', entity_links=()) -->
<ReadSqlSourceNode>
Expand Down
Loading

0 comments on commit b146895

Please sign in to comment.