CSV exports missing Custom headers

Hello there,

I have a local fork of metabase 0.41.2 that is embedded in a different application. I have set up a table card and customized some of the header labels in the GUI. However, when I try to export the table data to a CSV/json/xls from the embedded view, I see the original table label from the SQL alias. Due to the way our sql is constructed, we cannot change the sql Aliases for export purposes. However, when I open the card in the metabase console, I do see the custom labels when i export as xls (CSV and json still return the original aliases).

My question is, is it possible to export the custom header labels in a CSV export from an embedded view? Since we have a fork of the open source version, we can make changes to the code. I can see in the code that this function applies the custom headers in the xls export https://github.com/socialchorus/metabase/blob/ad1cee1fb6ebb060a152afca9443e865398b305e/src/metabase/query_processor/streaming/xlsx.clj#L402

however, when i try to copy this over to the CSV equivalent file, i get errors related to unknown keywords https://github.com/socialchorus/metabase/blob/ad1cee1fb6ebb060a152afca9443e865398b305e/src/metabase/query_processor/streaming/csv.clj

but i kept getting errors about

Invalid token: ::mb.viz/field-id Invalid token: ::mb.viz/column-name

I apologize my clojure skills are beginner-level

Any recommendations will be greatly appreciated

Hi @gqfup It would require more work that just copying from XLSX. There's an issue open about it:
https://github.com/metabase/metabase/issues/18572 - upvote by clicking :+1: on the first post

1 Like