Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Derived metric validation allows empty input metric set #269

Open
2 tasks done
tlento opened this issue Feb 27, 2024 · 0 comments
Open
2 tasks done

[Bug] Derived metric validation allows empty input metric set #269

tlento opened this issue Feb 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tlento
Copy link
Collaborator

tlento commented Feb 27, 2024

Is this a new bug in dbt-semantic-interfaces?

  • I believe this is a new bug in dbt-semantic-interfaces
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

An end user has reported a problem with a set.intersection() error in MetricFlow, which was ultimately caused by a mis-configured derived metric defined with no metric inputs. See the community slack thread for more details.

In looking at the derived metric validation logic, there is no check that the metric inputs are non-empty, only a check that all inputs provided exist.

Expected Behavior

If a metric config has derived metrics with no inputs specified, semantic validation should fail with an informative message.

Steps To Reproduce

Create a metric with a spec like this:

metrics:
  - name: bad_derived_metric
    type: derived
    description: "a bad derived metric"
    type_params:
      expr: "2 + 2"

This will pass validation.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:
- dbt-semantic-interfaces: 0.4.x through current main

Additional Context

No response

@tlento tlento added the bug Something isn't working label Feb 27, 2024
@tlento tlento self-assigned this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant