Copilot commented on code in PR #38170:
URL: https://github.com/apache/superset/pull/38170#discussion_r2885418475


##########
superset/commands/streaming_export/base.py:
##########
@@ -107,16 +107,49 @@ def _write_csv_header(
         buffer.truncate()
         return header_data, total_bytes
 
+    def _format_row_values(
+        self, row: tuple[Any, ...], decimal_separator: str | None
+    ) -> list[Any]:
+        """
+        Format row values, applying custom decimal separator if specified.
+
+        Args:
+            row: Database row as a tuple
+            decimal_separator: Custom decimal separator (e.g., ",") or None
+
+        Returns:
+            List of formatted values
+        """
+        if not decimal_separator or decimal_separator == ".":
+            return list(row)
+
+        formatted = []
+        for value in row:
+            if isinstance(value, float):
+                # Format float with custom decimal separator
+                formatted.append(str(value).replace(".", decimal_separator))
+            else:
+                formatted.append(value)
+        return formatted

Review Comment:
   `_format_row_values` only applies the custom decimal separator for `float` 
values. SQLAlchemy often returns `decimal.Decimal` for NUMERIC/DECIMAL columns 
(and some drivers return `numpy` numeric types), so `CSV_EXPORT['decimal']` 
will still be ignored for many real exports. Consider extending the type check 
to handle `Decimal` (and any other numeric types you expect) so decimal 
formatting is consistently applied.



-- 
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]

Reply via email to