-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix: Add Column Header to the exported CSV from query command #1313
Conversation
The CSV file generated using `mf query --csv <csv-file-name>` does not contain the header. This commit updates the function to include the column header as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @saurabh0402 ! Apologies for the delay, I was on vacation and most of the team relies on reviewer tags.
Could you add a changelog entry to this PR? See the contributing guide for instructions. That'll also ensure you get properly credited in our release notes.
Thank you!
Hey @tlento, thanks for reviewing this. I have added the changelog, please take a look now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks so much @saurabh0402 !
Hey @tlento, when can we expect this to be released? |
End of next week, maybe? I need to fix up some deployment issues to allow for a backport and patch release on dbt-metricflow, and that takes some time to test. |
Thanks a lot. |
# Issue #1285 The CSV exported from the `mf query <metric> --csv <csv-file-name>` command does not contain the column header. The CSV thus does not make too much sense. # Fix - The code [here](https://github.com/dbt-labs/metricflow/blob/main/dbt-metricflow/dbt_metricflow/cli/main.py#L344) is writing data to the CSV file. The column names aren't getting added to the file. - With this PR, we are adding the column names returned from `df.column_names` to the CSV to fix the issue.
…1354) This commit is a backport of PR #1313 to dbt-metricflow 0.7.x This will allow us to deploy @saurabh0402's fix for the following issue: #1285 Note - efficacy was tested via the CLI by running hatch build and doing a pip install of the build package into a clean VM, and running `mf query` with the `--csv` flag enabled. Co-authored-by: Saurabh Kumar <[email protected]>
Thanks 👍 |
Issue
#1285
The CSV exported from the
mf query <metric> --csv <csv-file-name>
command does not contain the column header. The CSV thus does not make too much sense.Fix
df.column_names
to the CSV to fix the issue.