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] metrics.filters.value doesn't accept any type other than string #4309

Closed
1 task done
buremba opened this issue Nov 19, 2021 · 1 comment
Closed
1 task done
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@buremba
Copy link
Contributor

buremba commented Nov 19, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If the column is a numeric/boolean value we need to define the filters as follows:

metrics:
  - name: new_customers
    label: New Customers
    model: ref('customer')
    description: "The number of paid customers who are using the product"
    type: count
    sql: c_custkey
    filters:
      - field: is_paying
        operator: "="
        value: "true"

Expected Behavior

It's ideal to use the appropriate types as follows:

metrics:
  - name: new_customers
    label: New Customers
    model: ref('customer')
    description: "The number of paid customers who are using the product"
    type: count
    sql: c_custkey
    filters:
      - field: is_paying
        operator: "="
        value: true

I believe that the filters.value should not enforce a type as we don't have strict operator values. The schema of value should be any.

Steps To Reproduce

No response

Relevant log output

If we pass boolean / numeric value to `metrics.filters.value`, dbt complains about the type.

Environment

- OS: MacOS
- Python: 3.9.7
- dbt: 1.0.0-rc1

What database are you using dbt with?

No response

Additional Context

No response

@buremba buremba added bug Something isn't working triage labels Nov 19, 2021
@buremba
Copy link
Contributor Author

buremba commented Nov 19, 2021

Not sure how I couldn't find the relevant issue but it seems to be a duplicate of #4294 :(

@buremba buremba closed this as completed Nov 19, 2021
@jtcohen6 jtcohen6 added duplicate This issue or pull request already exists and removed triage labels Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants