[SEMANTIC-107] [Bug] <Running Into Compilation Error on Metrics >
See original GitHub issueIs this a new bug in dbt_metrics?
- I believe this is a new bug in dbt_metrics
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
The compiler returns `
> " Compilation Error in model key_kpis (models\aggregation\key_kpis.sql) The name argument to ref() must be a string, got <class 'list'>"
when I tried running the metrics on one of my models.

Expected Behavior
I should be able to see a table from the metrics I have added.
Steps To Reproduce
- In my own virtual environment dbt, I add this code snippet to my schema.yml
metrics:
- name: gross_deposits
label: Gross Deposits
model: ref('deposits')
description: "Sum of amount_usd for Deposits"
calculation_method: sum
expression: amount_usd
timestamp: transfer_ts
time_grains: [day, week, month, quarter, year, all_time]
dimensions:
- registration_country
window:
count: 4
period: week
config:
enabled: True
- I query it with
{{ config(
materialized='table',
)}}
select *
from {{ metrics.calculate(
metric('gross_deposits'),
grain='week',
dimensions=['registration_country']
) }}
in a separate .sql file.
- I use a dbt run on my terminal to run the file.
Relevant log output
No response
Environment
- dbt=1.3.1
- dbt_metrics version: 1.3.2
Which database adapter are you using with dbt?
bigquery
Additional Context
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:8
Top Results From Across the Web
Issues · dbt-labs/dbt_metrics - GitHub
Contribute to dbt-labs/dbt_metrics development by creating an account on GitHub. ... [SEMANTIC-107] [Bug] <Running Into Compilation Error on Metrics > bug ...
Read more >Bug ID: JDK-8155701 The compiler fails with an AssertionError
AssertionError: typeSig ERROR at com.sun.tools.javac.code. ... Compiling /tmp/javac-bug/Bar.java An exception has occurred in the compiler (1.8.0_77).
Read more >Workaround for javac compilation order bug in maven
I'm encountering a bug in the Java compiler where the order of files submitted for compilation can cause code not to compile. I've...
Read more >Bugs in Programming
All these errors are called compile-time errors, because the Java compiler detects them while compiling our programs. We can link and run only...
Read more >Updating Eclipse from 4.9 to 4.10: false compiler errors - Bugs
The .java file has a main(String[]) class. When I try to Run As, no dropdown occurs but the Error Log shows (maybe that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Oh, I see. Now it’s clear 😃
I want to run the default calendar, so this is my code
Thank you!
Hi @oleg-agapov - are you trying to run the default calendar or your custom one?
Per the documentation in the README, you don’t want to include the var value as a ref statement. See below for an example where I’m telling the package to use the model
my_custom_calendarinstead of the default model.To run it I would then use
dbt run --s my_custom_calendar. If I wanted to use the default calendar, I’d usedbt run --s dbt_metrics_default_calendar