-
Notifications
You must be signed in to change notification settings - Fork 55
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
#228: first cut at supporting Pandas 2.0+ #345
#228: first cut at supporting Pandas 2.0+ #345
Conversation
Fixes error reported in #227:
|
Looks like the docs are failing to build, but work locally with |
gridstatus/ercot.py
Outdated
df = pd.DataFrame(data["data"][day]) | ||
df_transformed = df.apply( | ||
lambda col: col.apply( | ||
lambda x: x.get('gen') if isinstance(x, dict) else pd.NA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ruff linter is complaining this needs to be "gen"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 ... I see you guys use black formatting 🎉 . Fixed the formatting with black on the latest commit!
I don't entirely understand the readthedocs build process. The GitHub action that builds the docs did succeed. The output from the readthedocs build says
but |
This comment was marked as outdated.
This comment was marked as outdated.
Update: that PR is merged so you can merge or rebase those changes into this branch to fix the RTD issue. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
==========================================
- Coverage 91.92% 91.83% -0.10%
==========================================
Files 40 40
Lines 5935 5940 +5
==========================================
- Hits 5456 5455 -1
- Misses 479 485 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks a lot for taking this on!
Addresses the necessary changes when upgrading to Pandas 2.0+.
The farthest reaching breaking change appears to be in
_check_is_datetime_type
, which has been changed to use the newpd.api.types
methods.A lot of the changes here address FutureWarnings or DeprecationWarnings:
-
‘H’
and’T’
frequency strings are deprecated -> Use‘h’
or‘min’
- Passing bytes to
pd.read_excel
is deprecated -> Wrap withio.BytesIO
-
DataFrame.applymap
deprecated ->Use DataFrame.map
- Pandas/Tabula error=“ignore” deprecated -> Handle
pd.to_numeric
errors explicitly- Pandas set on copy of data frame -> replace
.fillna(_, inplace=True)
reference