With pandas 0.20.1, DataFrame write_points call fails with module 'pandas.tseries' has no attribute 'period'


Please, let me know if the below is a known issue:

I am using Python 3.6.0 |Anaconda custom (x86_64)| (default, Dec 23 2016, 13:19:00)

With pandas 0.19.2, the python-influxDB demo sample given with the Tutorials - pandas works as expected (see URL http://influxdb-python.readthedocs.io/en/latest/examples.html)

ipdb> client.write_points(df, ‘demo’)

With pandas 0.20.1, client.write_points fails and the stack trace shows:
ipdb> client.write_points(df, ‘demo’)

_ client.write_points(df, ‘demo’)_
_ File "/Users/_____/anaconda/lib/python3.6/site-packages/influxdb/dataframe_client.py", line 117, in write_points
_ numeric_precision=numeric_precision)

_ File "/Users/______/anaconda/lib/python3.6/site-packages/influxdb/dataframe_client.py", line 237, in convert_dataframe_to_lines
_ if not (isinstance(dataframe.index, pd.tseries.period.PeriodIndex) or

AttributeError: module ‘pandas.tseries’ has no attribute ‘period’



It looks like this has been moved to the “core” package in python instead, see the pathing…

[tester@msandn]:~/.../python3.6/site-packages/pandas$ grep -r "class PeriodIndex"
core/resample.py:class PeriodIndexResampler(DatetimeIndexResampler):
core/resample.py:class PeriodIndexResamplerGroupby(_GroupByMixin, PeriodIndexResampler):
core/indexes/period.py:class PeriodIndex(DatelikeOps, DatetimeIndexOpsMixin, Int64Index):

I think this is bug-worthy for the plugin. That being said, the docs technically state support for 3.4. The plugin would have to be updated to handle >3.4.

1 Like

Thanks for the quick answer. I opened an issue here, https://github.com/influxdata/influxdb-python/issues/456.
To your point, certainly a better place to start of.



Any chance you can downrev to 0.19.2 for now? It’s not latest-greatest, but still should be fine for this purpose.


It was done before reporting the issue with a simple

$ conda install pandas=0.19.2


Yep, super…it sucks having to keep your anaconda install custom but hopefully we can merge the bugfix soon.


Two bugfixes in place now, waiting to get merged.

1 Like