Is this a new bug in metricflow?
Current Behavior
When running mf query with multiple --where flags, only the final --where is applied in the generated SQL. Earlier filters are silently dropped. For example, only ad__ad_status = 'active' appears, while the preceding ad__ad_type = 'googleads' filter is missing.
Expected Behavior
Generated SQL includes both filters in the WHERE clause, effectively:
... WHERE ad__ad_type = 'googleads' AND ad__ad_status = 'active'
Steps To Reproduce
- Run:
mf query --metrics ad_cost
--group-by ad__platform
--where "{{ Dimension('ad__ad_type') }} = 'googleads'"
--where "{{ Dimension('ad__ad_status') }} = 'active'"
--explain
- Inspect the generated SQL.
- Observe that only the second filter is present in the WHERE clause.
Relevant log output
SELECT
ad__ad_id
, SUM(ad_cost) AS ad_cost
FROM (
SELECT
ad_src_10000.ad_id AS ad__ad_id
, ad_stats_src_10000.cost AS ad_cost
FROM `pmg-datawarehouse-staging`.`test_core`.`fact_ad` ad_stats_src_10000
LEFT OUTER JOIN
`pmg-datawarehouse-staging`.`test_core`.`dim_ad` ad_src_10000
ON
ad_stats_src_10000.ad_join_key = ad_src_10000.alli_id
) subq_4
WHERE ad__ad_status = 'active'
GROUP BY
ad__ad_id
Environment
- OS: macOS 15.7.3 (Build 24G419)
- Python: 3.10.5
- dbt: 1.10.9
- metricflow: 0.11.0
Which database are you using?
No response
Additional Context
