metricflow icon indicating copy to clipboard operation
metricflow copied to clipboard

[SL-2418] [Bug] Missing column names when writing a query to CSV

Open Jstein77 opened this issue 8 months ago • 1 comments

Is this a new bug in metricflow?

  • [X] I believe this is a new bug in metricflow
  • [X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When I run mf query --metrics revenue --group-by metric_time__week --csv test the csv result does not include the metric or dimension names.

The first for rows for test.csv are:

2016-09-26 00:00:00,4221.0
2016-10-31 00:00:00,4880.0
2016-11-14 00:00:00,6020.0
2016-11-21 00:00:00,6530.0

Expected Behavior

I expect the first row of the CSV to be the metrics and dimensions in my query

metric_time__week, revenue
2016-09-26 00:00:00,4221.0
2016-10-31 00:00:00,4880.0
2016-11-14 00:00:00,6020.0
2016-11-21 00:00:00,6530.0

Steps To Reproduce

  1. In dbt 1.8 and mf version 0.7.0 run mf query --metrics revenue_offset --group-by metric_time__week --csv test
  2. The CSV will not inlcude the metric and dimension names in the first row.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:
- metricflow:

Which database are you using?

No response

Additional Context

No response

SL-2418

Jstein77 avatar Jun 14 '24 22:06 Jstein77