You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/01/22 07:03:34 UTC

[incubator-superset] branch master updated: Bump pandas to 0.25.3 (#8985)

This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e46ff23  Bump pandas to 0.25.3 (#8985)
e46ff23 is described below

commit e46ff239afc79af5753cfe82779fa87796f46a27
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Wed Jan 22 09:03:19 2020 +0200

    Bump pandas to 0.25.3 (#8985)
    
    * Bump pandas to 0.25.3 as per recommendation to get ready for 1.0
    
    * Localize timezone aware Pandas series prior to Arrow conversion
---
 requirements.txt       | 2 +-
 setup.py               | 2 +-
 superset/result_set.py | 4 +++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index ba25941..df5218b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -52,7 +52,7 @@ marshmallow-sqlalchemy==0.17.0  # via flask-appbuilder
 marshmallow==2.19.5       # via flask-appbuilder, marshmallow-enum, marshmallow-sqlalchemy
 msgpack==0.6.1
 numpy==1.17.0             # via pandas, pyarrow
-pandas==0.24.2
+pandas==0.25.3
 parsedatetime==2.4
 pathlib2==2.3.4
 polyline==1.4.0
diff --git a/setup.py b/setup.py
index 0b274e5..da94364 100644
--- a/setup.py
+++ b/setup.py
@@ -90,7 +90,7 @@ setup(
         "isodate",
         "markdown>=3.0",
         "msgpack>=0.6.1, <0.7.0",
-        "pandas>=0.24.2, <0.25.0",
+        "pandas>=0.25.3, <1.0",
         "parsedatetime",
         "pathlib2",
         "polyline",
diff --git a/superset/result_set.py b/superset/result_set.py
index dd1ef7d..bc78fd6 100644
--- a/superset/result_set.py
+++ b/superset/result_set.py
@@ -91,9 +91,11 @@ class SupersetResultSet:
                     if sample and isinstance(sample, datetime.datetime):
                         try:
                             if sample.tzinfo:
+                                tz = sample.tzinfo
                                 series = pd.Series(array[:, i], dtype="datetime64[ns]")
+                                series = pd.to_datetime(series).dt.tz_localize(tz)
                                 pa_data[i] = pa.Array.from_pandas(
-                                    series, type=pa.timestamp("ns", tz=sample.tzinfo)
+                                    series, type=pa.timestamp("ns", tz=tz)
                                 )
                         except Exception as e:
                             logging.exception(e)