Skip to content

Commit

Permalink
Rename start/end to first/last
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jun 11, 2024
1 parent 881e34f commit 9c1fa05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@
},
"period_agg": {
"enum": [
"START",
"END",
"FIRST",
"LAST",
"AVERAGE",
"start",
"end",
"first",
"last",
"average"
]
},
Expand Down
2 changes: 1 addition & 1 deletion dbt_semantic_interfaces/parsing/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
export_destination_type_values = ["TABLE", "VIEW"]
export_destination_type_values += [x.lower() for x in export_destination_type_values]

period_agg_values = ["START", "END", "AVERAGE"]
period_agg_values = ["FIRST", "LAST", "AVERAGE"]
period_agg_values += [x.lower() for x in period_agg_values]


Expand Down
4 changes: 2 additions & 2 deletions dbt_semantic_interfaces/type_enums/period_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
class PeriodAggregation(ExtendedEnum):
"""Options for how to aggregate across a time period."""

START = "start"
END = "end"
FIRST = "first"
LAST = "last"
AVERAGE = "average"
6 changes: 3 additions & 3 deletions tests/validations/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def test_cumulative_metrics() -> None: # noqa: D
type_params=PydanticMetricTypeParams(
measure=PydanticMetricInputMeasure(name=measure_name),
window=PydanticMetricTimeWindow(count=1, granularity=TimeGranularity.WEEK),
cumulative_type_params=PydanticCumulativeTypeParams(period_agg=PeriodAggregation.END),
cumulative_type_params=PydanticCumulativeTypeParams(period_agg=PeriodAggregation.LAST),
),
),
metric_with_guaranteed_meta(
Expand Down Expand Up @@ -628,7 +628,7 @@ def test_cumulative_metrics() -> None: # noqa: D
grain_to_date=TimeGranularity.MONTH,
cumulative_type_params=PydanticCumulativeTypeParams(
window=PydanticMetricTimeWindow(count=1, granularity=TimeGranularity.WEEK),
period_agg=PeriodAggregation.START,
period_agg=PeriodAggregation.FIRST,
),
),
),
Expand Down Expand Up @@ -661,7 +661,7 @@ def test_cumulative_metrics() -> None: # noqa: D
type=MetricType.CUMULATIVE,
type_params=PydanticMetricTypeParams(
measure=PydanticMetricInputMeasure(name=measure_name),
cumulative_type_params=PydanticCumulativeTypeParams(period_agg=PeriodAggregation.START),
cumulative_type_params=PydanticCumulativeTypeParams(period_agg=PeriodAggregation.FIRST),
),
),
],
Expand Down

0 comments on commit 9c1fa05

Please sign in to comment.