Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit bcac807

Browse files
committed
fix already tz-aware error
1 parent d370895 commit bcac807

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

influxdb/_dataframe_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ def _to_dataframe(self, rs, dropna=True):
202202
df = pd.DataFrame(data)
203203
df.time = pd.to_datetime(df.time)
204204
df.set_index('time', inplace=True)
205-
df.index = df.index.tz_localize('UTC')
205+
if df.index.tzinfo is None:
206+
df.index = df.index.tz_localize('UTC')
206207
df.index.name = None
207208
result[key].append(df)
208209
for key, data in result.items():

0 commit comments

Comments
 (0)