Skip to content

Streaming CSV Export ignores CSV_EXPORT settings (encoding=utf-8-sig and sep=';') while ZIP CSV export respects them #45347

Open

Description

@maicnaatz

CSV_EXPORT settings are not applied consistently across CSV export implementations.

With the following configuration in superset_config.py:

CSV_EXPORT_ = {"encoding": "utf-8-sig", "sep": ";",}

Only ZIP-based CSV exports correctly generate:

UTF-8 with BOM
Semicolon-delimited CSV

However, direct/streaming CSV chart downloads ignore these settings and generate:

UTF-8 without BOM
Comma-separated CSV
This leads to inconsistent export behavior and causes interoperability issues with Microsoft Excel.

Expected Behavior

All CSV export methods should respect the configured values

Actual Behavior
ZIP Export

Produces:
    UTF-8 BOM
    Semicolon delimiter
    Excel opens the file correctly via double-click.

Direct CSV Download (Streaming Export)

Produces:
    UTF-8 (without BOM)
    Comma delimiter
    Excel does not correctly interpret the file when opened via double-click:
    Umlauts appear corrupted (e.g. Müller)
    Columns may not be split correctly depending on regional settings

Test A: ZIP Export
Export data using a ZIP-based export path.

Result:
    delimiter = ;
    file encoding = UTF-8-BOM
    Excel opens correctly via double-click
    umlauts displayed correctly

Test B: Direct CSV Download
Export the same data using the direct CSV download functionality (streaming export).

Result:
    delimiter = ,
    file encoding = UTF-8 (without BOM)
    Excel opens incorrectly via double-click
    umlauts appear corrupted (e.g. Müller)

Environment

OS: Ubuntu 24.04
Python: 3.11
Metadata DB: MySQL
Browser: Edge / Chrome

Activity

  1. schizophrenicmaniac commented on Oct 15, 2026

    @schizophrenicmaniac
    Contributor

    Hi, I'd like to work on this. On master the streaming export already applies the CSV_EXPORT sep, but _execute_query_and_stream in streaming_export/base.py yields str chunks sent as plain UTF-8, so no BOM. I'd encode them with the configured encoding (BOM only once) and add tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions