You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2022/07/19 03:12:52 UTC
[superset] 01/01: Replace pd.DataFrame.from_records with pd.DataFrame
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch john-bodley--fix-20151
in repository https://gitbox.apache.org/repos/asf/superset.git
commit cb7d25ca69414d7e9fae7412174ab98a18a7296d
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Mon Jul 18 20:12:43 2022 -0700
Replace pd.DataFrame.from_records with pd.DataFrame
---
superset/views/core.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/superset/views/core.py b/superset/views/core.py
index 0598c72446..8fdbc40dcd 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2502,8 +2502,7 @@ 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)
logger.info("Using pandas to convert to CSV")
else:
logger.info("Running a query to turn into CSV")