You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/08/11 01:31:49 UTC
[superset] 01/01: fix: timezone issue in Pandas 2
This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch sc_73474
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 378dc1a33e407737ff83bf7529111b8030f2238f
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Thu Aug 10 18:31:21 2023 -0700
fix: timezone issue in Pandas 2
---
superset/result_set.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/superset/result_set.py b/superset/result_set.py
index 4ca39cba2b..4e50f3e758 100644
--- a/superset/result_set.py
+++ b/superset/result_set.py
@@ -167,12 +167,11 @@ class SupersetResultSet:
try:
if sample.tzinfo:
tz = sample.tzinfo
- series = pd.Series(
- array[column], dtype="datetime64[ns]"
- )
- series = pd.to_datetime(series).dt.tz_localize(tz)
+ series = pd.Series(array[column])
+ series = pd.to_datetime(series).dt.tz_localize(None)
pa_data[i] = pa.Array.from_pandas(
- series, type=pa.timestamp("ns", tz=tz)
+ series,
+ type=pa.timestamp("ns", tz=tz),
)
except Exception as ex: # pylint: disable=broad-except
logger.exception(ex)