rusackas commented on code in PR #42735:
URL: https://github.com/apache/superset/pull/42735#discussion_r3727851707
##########
superset/charts/client_processing.py:
##########
@@ -379,8 +379,17 @@ def apply_client_processing( # noqa: C901
# reports to avoid unwanted conversions
# This allows users to control which values should be treated as
null/NA
na_values = current_app.config["REPORTS_CSV_NA_NAMES"]
+ # QueryContextProcessor.get_data encodes CSV `data` to bytes using
+ # the configured CSV_EXPORT encoding (default utf-8), matching
+ # the encoding SQL Lab's own CSV export uses -- decode with that
+ # same encoding rather than assuming `data` is already a `str`.
+ csv_data = (
+ data.decode(csv_export_config.get("encoding", "utf-8"))
+ if isinstance(data, bytes)
+ else data
+ )
Review Comment:
Good catch — fixed, decoding CSV bytes before the strip/empty check now, and
added `b""`/`b"\n"` to the no-data test parametrization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]