This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new e1fd90697c fix(csv): Do not coerce persisted data integer columns to
float (#20760)
e1fd90697c is described below
commit e1fd90697c1ed4f72e7982629779783ad9736a47
Author: John Bodley <[email protected]>
AuthorDate: Tue Jul 19 09:52:47 2022 -0700
fix(csv): Do not coerce persisted data integer columns to float (#20760)
* Replace pd.DataFrame.from_records with pd.DataFrame
* Remove unused code
* Update core.py
* Update core.py
* Update csv.py
* Update core.py
---
superset/views/core.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/superset/views/core.py b/superset/views/core.py
index 0598c72446..c27dcfb4a6 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2502,8 +2502,13 @@ class Superset(BaseSupersetView): # pylint:
disable=too-many-public-methods
obj = _deserialize_results_payload(
payload, query, cast(bool, results_backend_use_msgpack)
)
- columns = [c["name"] for c in obj["columns"]]
- df = pd.DataFrame.from_records(obj["data"], columns=columns)
+
+ df = pd.DataFrame(
+ data=obj["data"],
+ dtype=object,
+ columns=[c["name"] for c in obj["columns"]],
+ )
+
logger.info("Using pandas to convert to CSV")
else:
logger.info("Running a query to turn into CSV")