Skip to content

Commit d85ecee

Browse files
authored
fix bug in _convert_dataframe_to_json function that need not transform index if data type of index is already DatatimeIndex (influxdata#623)
1 parent c35e49e commit d85ecee

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
@@ -252,7 +252,8 @@ def _convert_dataframe_to_json(dataframe,
252252
field_columns = list(
253253
set(dataframe.columns).difference(set(tag_columns)))
254254

255-
dataframe.index = pd.to_datetime(dataframe.index)
255+
if not isinstance(dataframe.index, pd.DatetimeIndex):
256+
dataframe.index = pd.to_datetime(dataframe.index)
256257
if dataframe.index.tzinfo is None:
257258
dataframe.index = dataframe.index.tz_localize('UTC')
258259

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy