sodadata / soda-sql

Soda SQL and Soda Spark have been deprecated and replaced by Soda Core. docs.soda.io/soda-core/overview.html
https://docs.soda.io/
Apache License 2.0
60 stars 15 forks source link

When creating custom sql_metrics of type failed_rows I cannot set the name of the test #340

Open TimoKoole opened 2 years ago

TimoKoole commented 2 years ago

Describe the bug When creating custom sql_metrics of type failed_rows I cannot set the name of the test. Instead it will generate something ugly

To Reproduce Use for example the following metric

sql_metrics:
  - type: failed_rows
    name: STOCK_KEY_DUPLICATES
    title: How many duplicate stock keys
    sql: |
      SELECT stock_key, Count(*) as COUNT
      FROM   cluster_viewer_soda
      GROUP  BY stock_key
      HAVING Count(*) > 1 
      ORDER BY stock_key

I would expect this leads to the name "How many duplicate stock keys". Instead I get the name: sqlmetric(0) STOCK_KEY_DUPLICATES(STOCK_KEY_DUPLICATES == 0)

Context soda-sql-snowflake==2.1.6