Skip to content

Commit

Permalink
Bump pandas to 0.25.3 (#8985)
Browse files Browse the repository at this point in the history
* Bump pandas to 0.25.3 as per recommendation to get ready for 1.0

* Localize timezone aware Pandas series prior to Arrow conversion
  • Loading branch information
villebro authored Jan 22, 2020
1 parent d02cf2f commit e46ff23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_git_sha():
"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",
Expand Down
4 changes: 3 additions & 1 deletion superset/result_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ def __init__(
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)
Expand Down

0 comments on commit e46ff23

Please sign in to comment.