From bf941a3661eed3f4bf2aea6565c5e75242e6a50d Mon Sep 17 00:00:00 2001 From: Will Deng Date: Tue, 12 Nov 2024 16:35:57 -0500 Subject: [PATCH] fix tests --- tests/functional/metrics/test_metrics.py | 12 ++++++------ .../test_semantic_layer_nodes_satisfy_protocols.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/functional/metrics/test_metrics.py b/tests/functional/metrics/test_metrics.py index 3f8fba2a19c..7c0842a7414 100644 --- a/tests/functional/metrics/test_metrics.py +++ b/tests/functional/metrics/test_metrics.py @@ -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 @@ -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 diff --git a/tests/unit/test_semantic_layer_nodes_satisfy_protocols.py b/tests/unit/test_semantic_layer_nodes_satisfy_protocols.py index 3838b1a4a33..156b4f9b9a8 100644 --- a/tests/unit/test_semantic_layer_nodes_satisfy_protocols.py +++ b/tests/unit/test_semantic_layer_nodes_satisfy_protocols.py @@ -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") @@ -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, )