Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDee committed Nov 12, 2024
1 parent 76379bd commit bf941a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions tests/functional/metrics/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_simple_metric(
)
assert (
manifest.metrics["metric.test.number_of_people"].time_granularity
== TimeGranularity.MONTH
== TimeGranularity.MONTH.value
)
assert manifest.metrics["metric.test.collective_tenure"].time_granularity is None

Expand Down Expand Up @@ -436,25 +436,25 @@ def test_cumulative_metric(self, project):
metric_ids = set(manifest.metrics.keys())
expected_metric_ids_to_cumulative_type_params = {
"metric.test.weekly_visits": CumulativeTypeParams(
window=MetricTimeWindow(count=7, granularity=TimeGranularity.DAY),
window=MetricTimeWindow(count=7, granularity=TimeGranularity.DAY.value),
period_agg=PeriodAggregation.AVERAGE,
),
"metric.test.cumulative_orders": CumulativeTypeParams(
period_agg=PeriodAggregation.LAST
),
"metric.test.orders_ytd": CumulativeTypeParams(
grain_to_date=TimeGranularity.YEAR, period_agg=PeriodAggregation.FIRST
grain_to_date=TimeGranularity.YEAR.value, period_agg=PeriodAggregation.FIRST
),
"metric.test.monthly_orders": CumulativeTypeParams(
window=MetricTimeWindow(count=1, granularity=TimeGranularity.MONTH),
window=MetricTimeWindow(count=1, granularity=TimeGranularity.MONTH.value),
period_agg=PeriodAggregation.AVERAGE,
),
"metric.test.yearly_orders": CumulativeTypeParams(
window=MetricTimeWindow(count=1, granularity=TimeGranularity.YEAR),
window=MetricTimeWindow(count=1, granularity=TimeGranularity.YEAR.value),
period_agg=PeriodAggregation.FIRST,
),
"metric.test.visits_mtd": CumulativeTypeParams(
grain_to_date=TimeGranularity.MONTH, period_agg=PeriodAggregation.FIRST
grain_to_date=TimeGranularity.MONTH.value, period_agg=PeriodAggregation.FIRST
),
"metric.test.cumulative_visits": CumulativeTypeParams(
period_agg=PeriodAggregation.FIRST
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_semantic_layer_nodes_satisfy_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def where_filter() -> WhereFilter:

@pytest.fixture(scope="session")
def metric_time_window() -> MetricTimeWindow:
return MetricTimeWindow(count=1, granularity=TimeGranularity.DAY)
return MetricTimeWindow(count=1, granularity=TimeGranularity.DAY.value)


@pytest.fixture(scope="session")
Expand All @@ -211,7 +211,7 @@ def complex_metric_input(metric_time_window, where_filter) -> MetricInput:
filter=where_filter,
alias="aliased_metric_input",
offset_window=metric_time_window,
offset_to_grain=TimeGranularity.DAY,
offset_to_grain=TimeGranularity.DAY.value,
)


Expand Down

0 comments on commit bf941a3

Please sign in to comment.