This is an automated email from the ASF dual-hosted git repository. sadpandajoe pushed a commit to branch fix-report-csv-empty-chart-data in repository https://gitbox.apache.org/repos/asf/superset.git
commit be0c38c2da583f5c18e435eb45f50156bb7fad23 Author: Joe Li <[email protected]> AuthorDate: Sat Nov 14 10:37:58 2026 +0000 test(reports): assert a no-row export passes through unchanged The pivot table guard now compares the returned export with the input instead of only checking that it is non-empty. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --- tests/unit_tests/charts/test_client_processing.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/unit_tests/charts/test_client_processing.py b/tests/unit_tests/charts/test_client_processing.py index e432ee7e897..d8b6e22409a 100644 --- a/tests/unit_tests/charts/test_client_processing.py +++ b/tests/unit_tests/charts/test_client_processing.py @@ -4640,14 +4640,8 @@ def test_apply_client_processing_pivot_table_v2_export_without_rows( the chart data request failed with a server error instead of exporting the empty result like the Explore download does. """ - result = { - "queries": [ - { - "result_format": result_format, - "data": _header_only_export(result_format), - } - ] - } + payload = _header_only_export(result_format) + result = {"queries": [{"result_format": result_format, "data": payload}]} form_data = { "viz_type": "pivot_table_v2", "groupbyRows": groupby_rows, @@ -4660,13 +4654,8 @@ def test_apply_client_processing_pivot_table_v2_export_without_rows( processed = apply_client_processing(result, form_data) assert len(processed["queries"]) == 1 - data = processed["queries"][0]["data"] - if result_format == ChartDataResultFormat.CSV: - assert "SUM(num)" in ( - data.decode("utf-8-sig") if isinstance(data, bytes) else data - ) - else: - assert data + # the export is passed through untouched, headers only + assert processed["queries"][0]["data"] == payload def test_apply_client_processing_csv_format_no_data_multiple_queries():
