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

'Index' object has no attribute 'tzinfo' #696

Open
h4nz11 opened this issue Apr 1, 2019 · 5 comments
Open

'Index' object has no attribute 'tzinfo' #696

h4nz11 opened this issue Apr 1, 2019 · 5 comments

Comments

@h4nz11
Copy link

h4nz11 commented Apr 1, 2019

Hello,
I've tried to update pandas to the latest version and make this query
SELECT mean(value) FROM data WHERE time >= '2018-10-01' AND time < '2019-02-01' GROUP BY time(1d) tz('Europe/Prague')
but if I hit time period withnout any data, I will get this error

influxdb/_dataframe_client.pyc in _to_dataframe(self, rs, dropna)
    203             df.time = pd.to_datetime(df.time)
    204             df.set_index('time', inplace=True)
--> 205             if df.index.tzinfo is None:
    206                 df.index = df.index.tz_localize('UTC')
    207             df.index.name = None

AttributeError: 'Index' object has no attribute 'tzinfo'
@DtheRock
Copy link

I am having the same issue too.

@dtosato
Copy link

dtosato commented Jul 10, 2019

Any solution to this issue?

@h4nz11
Copy link
Author

h4nz11 commented Jul 10, 2019

I have pandas pinned to version < 0.24

@markif
Copy link

markif commented Oct 2, 2019

We run into the same issue and I can confirm that by setting pandas < 0.24 we could resolve it (or by leaving tz('Europe/Prague') away or extending the query with epoch="ns" (see: #676 (comment)) but that is probably not what one wants to do).

markif pushed a commit to markif/WeatherStation_HS2019 that referenced this issue Oct 2, 2019
@dtosato
Copy link

dtosato commented Jan 22, 2020

Could you please fix this issue for the latest pandas release? At the moment, it is no possible to use google colab with influxdb due to this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants