Skip to content

Commit

Permalink
Handle TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Oct 10, 2023
1 parent 5f331f1 commit 42d4e27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion metricflow/plan_conversion/node_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def __init__( # noqa: D
self._semantic_model_lookup = semantic_model_lookup
self._join_evaluator = SemanticModelJoinEvaluator(semantic_model_lookup)

# TODO: add test with time constraint
def add_time_range_constraint(
self,
source_nodes: Sequence[BaseOutput],
Expand Down
4 changes: 3 additions & 1 deletion metricflow/query/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ def _validate_no_time_dimension_query(self, metric_references: Sequence[MetricRe
"dimension 'metric_time'."
)

# TODO: write tests for invalid linkable specs - should error
def _validate_linkable_specs_for_metrics(
self,
metric_references: Tuple[MetricReference, ...],
Expand Down Expand Up @@ -302,6 +301,9 @@ def _construct_metric_specs_for_query(
def _get_metric_names(
self, metric_names: Optional[Sequence[str]], metrics: Optional[Sequence[MetricQueryParameter]]
) -> Sequence[str]:
if not (metric_names or metrics):
return []

assert_exactly_one_arg_set(metric_names=metric_names, metrics=metrics)
return metric_names if metric_names else [m.name for m in metrics] if metrics else []

Expand Down
3 changes: 3 additions & 0 deletions metricflow/test/query/test_query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ def test_query_parser(bookings_query_parser: MetricFlowQueryParser) -> None: #
),
)

with pytest.raises(UnableToSatisfyQueryError):
bookings_query_parser.parse_and_validate_query(group_by_names=["random_stuff"])


def test_query_parser_with_object_params(bookings_query_parser: MetricFlowQueryParser) -> None: # noqa: D
Metric = namedtuple("Metric", ["name", "descending"])
Expand Down

0 comments on commit 42d4e27

Please sign in to comment.