bito-code-review[bot] commented on code in PR #44739:
URL: https://github.com/apache/superset/pull/44739#discussion_r4151135215
##########
superset/commands/sql_lab/export.py:
##########
@@ -140,6 +141,12 @@ def run(
self._query.schema,
)[:limit]
+ # Preserve exact decimals without scientific notation in CSV output.
+ for name, column in df.items():
+ for label, value in column.items():
+ if isinstance(value, Decimal) and value.is_finite():
+ df.at[label, name] = format(value, "f")
Review Comment:
<!-- Bito Reply -->
The suggestion to use a vectorized `Series.map` instead of a cell-by-cell
`df.at` loop is appropriate. The proposed change significantly improves
performance for large datasets by avoiding repeated overhead, and moving the
formatting logic to a dedicated helper improves the modularity of the command.
**superset/commands/sql_lab/export.py**
```
+ # Preserve exact decimals without scientific notation in CSV output.
+ for name, column in df.items():
+ for label, value in column.items():
+ if isinstance(value, Decimal) and value.is_finite():
+ df.at[label, name] = format(value, "f")
```
--
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]