Skip to content
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

Pin pandas to avoid broken round function #2305

Merged
merged 3 commits into from
Jan 22, 2024
Merged

Pin pandas to avoid broken round function #2305

merged 3 commits into from
Jan 22, 2024

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Jan 22, 2024

Description

This PR fixes recent test failures that are caused by a bug in pandas. This bug breaks the round function that we use to round to the nearest second:

new_datetimes = (year_month_day + day_float).round(
'S'
).dt.to_pydatetime()

In addition, this removes the use of two deprecated features:

  1. Replace 'S' by 's' (see https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases)
  2. Surround DatetimeProperties.to_pydatetime by np.array as recommended in the deprecation message. Unfortunately, this does not remove the warning, but hopefully this will avoid problems in the future.

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@schlunma schlunma added this to the v2.11.0 milestone Jan 22, 2024
@schlunma schlunma self-assigned this Jan 22, 2024
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d6008f3) 93.72% compared to head (9b020f0) 93.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2305   +/-   ##
=======================================
  Coverage   93.72%   93.72%           
=======================================
  Files         238      238           
  Lines       13122    13123    +1     
=======================================
+ Hits        12299    12300    +1     
  Misses        823      823           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cheers, Manu! Always helpful to add refs to issue or PR numbers when we pin deps 👍

.github/workflows/run-tests.yml Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
@valeriupredoi
Copy link
Contributor

many thanks, Manu 🍺

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

Successfully merging this pull request may close these issues.

2 participants