Skip to content

Commit

Permalink
Re-enable broken tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Oct 30, 2024
1 parent 247b290 commit 9761de5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _get_min_queryable_time_granularity(self, metric_reference: MetricReference)
)
agg_time_dimension_grains.add(measure_properties.agg_time_granularity)

return min(agg_time_dimension_grains, key=lambda time_granularity: time_granularity.to_int())
return max(agg_time_dimension_grains, key=lambda time_granularity: time_granularity.to_int())

def get_joinable_scd_specs_for_metric(self, metric_reference: MetricReference) -> Sequence[LinkableInstanceSpec]:
"""Get the SCDs that can be joined to a metric."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import logging

import pytest
from dbt_semantic_interfaces.references import MetricReference
from dbt_semantic_interfaces.type_enums import TimeGranularity
from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup

logger = logging.getLogger(__name__)


@pytest.mark.skip("get_min_queryable_time_granularity has a bug with agg. time dimensions at different grains.")
def test_min_queryable_time_granularity_for_different_agg_time_grains( # noqa: D103
extended_date_semantic_manifest_lookup: SemanticManifestLookup,
) -> None:
Expand Down
23 changes: 11 additions & 12 deletions tests_metricflow/integration/test_cases/itest_dimensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,17 @@ integration_test:
GROUP BY
v.ds
---
# TODO: Test is currently broken.
#integration_test:
# name: query_non_default_time_dimension_without_granularity
# description: Query just a time dimension, no granularity specified. Should assume default granularity for dimension.
# model: EXTENDED_DATE_MODEL
# group_bys: [ "booking__monthly_ds"]
# check_query: |
# SELECT
# ds AS booking__monthly_ds__month
# FROM {{ source_schema }}.fct_bookings_extended_monthly
# GROUP BY
# ds
integration_test:
name: query_non_default_time_dimension_without_granularity
description: Query just a time dimension, no granularity specified. Should assume default granularity for dimension.
model: EXTENDED_DATE_MODEL
group_bys: [ "booking_monthly__ds"]
check_query: |
SELECT
ds AS booking_monthly__ds__month
FROM {{ source_schema }}.fct_bookings_extended_monthly
GROUP BY
ds
---
integration_test:
name: query_dimension_with_constraint_from_diff_source
Expand Down

0 comments on commit 9761de5

Please sign in to comment.