Skip to content

deprecated calls in flux_csv_parser.py #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jimwhitfield opened this issue Feb 16, 2022 · 4 comments · Fixed by #407
Closed

deprecated calls in flux_csv_parser.py #406

jimwhitfield opened this issue Feb 16, 2022 · 4 comments · Fixed by #407

Comments

@jimwhitfield
Copy link

I am using "the latest" "influxdb_client" and "the latest" "pandas" (and python 3.8)
$ python3 -m pip show pandas
Name: pandas
Version: 1.4.1

When running code, I get a warning message in my output:
/home/jupyter/.voila_env/lib/python3.8/site-packages/influxdb_client/client/flux_csv_parser.py:
190: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
line 190: return self._data_frame.astype(_temp_df.dtypes).append(_temp_df)

Mitigation attempt: I changed influxdb_client/client/flux_csv_parser.py line 190
# Append data
return self._data_frame.astype(_temp_df.dtypes).concat(_temp_df)
Alas, this did not solve the problem. Instead, I had this execution error:
AttributeError: 'DataFrame' object has no attribute 'concat'

I'd welcome any advice or update. I'll probably spend some time on this before I pull pandas back down to an earlier release.
Thanks

@bednar
Copy link
Contributor

bednar commented Feb 16, 2022

Hi @jimwhitfield,

thanks for using our client.

As a workaround you can use the Pandas 1.3.5:

pip install pandas==1.3.5

Regards

@zengbiao
Copy link

i found the same issue with pandas==1.4.1, correct it:
self._data_frame=pd.concat([self._data_frame, _temp_df]) #zb
return self._data_frame

@bednar
Copy link
Contributor

bednar commented Feb 16, 2022

@zengbiao, I have prepared a fixed version within #407. If you would like to use this fixed version before regular release, please install client via:

pip install git+https://github.com/influxdata/influxdb-client-python.git@pandas_deprecation

@bednar bednar added this to the 1.26.0 milestone Feb 17, 2022
@jimwhitfield
Copy link
Author

Thanks for that quick turnaround. I'm happily using that change @bednar posted.

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

Successfully merging a pull request may close this issue.

3 participants