Skip to content

Conversation

@vinisalazar
Copy link
Contributor

Hi,

Problem

When running ERDDAP.griddap_initialize, I would get the following warning: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. My Pandas version is 1.4.0.

Proposed solution

If merged, this PR will modify the _griddap_get_constraints function in order to remove the Pandas FutureWarning that was introduced in the latest Pandas versions.

I ran Pytest, Pre-Commit, and tested the function locally (by running ERDDAP.griddap_initialize), and things seem to be working properly.

Summary of changes:

  • Replace frame.append() with pd.concat()
  • Replace table.index = with .set_index(drop=True)
  • Format code with Black

Thank you for any assistance you can provide,

Vini

@vinisalazar vinisalazar marked this pull request as draft January 31, 2022 06:37
@vinisalazar
Copy link
Contributor Author

Update: just did some more checks and this introduces some bugs. Will investigate further and push to this PR.

@vinisalazar
Copy link
Contributor Author

Fixed with f94c9b8. Had forgotten to overwrite the new table variable.

@ocefpaf
Copy link
Member

ocefpaf commented Feb 3, 2022

@vinisalazar is this one ready for review?

@vinisalazar vinisalazar marked this pull request as ready for review February 5, 2022 22:50
@vinisalazar
Copy link
Contributor Author

Yes, thank you for the reminder!

vinisalazar and others added 4 commits March 15, 2022 08:37
  This removes the Pandas FutureWarning triggered by the use of
  frame.append()

  Summary of changes:
    - Replace `frame.append()` with `pd.concat()`
    - Replace `table.index =` with `.set_index(drop=True)`
@ocefpaf ocefpaf force-pushed the pandas_deprecation_warning branch from 9440a3b to e739ff4 Compare March 15, 2022 11:38
@ocefpaf ocefpaf merged commit 81b56b6 into ioos:main Mar 15, 2022
@vinisalazar
Copy link
Contributor Author

@ocefapf apologies for missing your comment about the nesting. Thank you for the review and merge!

@ocefpaf
Copy link
Member

ocefpaf commented Mar 16, 2022

No problem. I'm doing some housekeeping to get ready for GSoC and went ahead with this one. Hope to see more PRs from you in the future ;-p

@vinisalazar vinisalazar deleted the pandas_deprecation_warning branch July 28, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants