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

Avoid pandas warning #3336

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Avoid pandas warning #3336

merged 1 commit into from
Dec 22, 2023

Conversation

dopplershift
Copy link
Member

@dopplershift dopplershift commented Dec 22, 2023

Apparently with Pandas 2.2.0 (tested with the just released rc0) freq='H' is deprecated, in favor of freq='h'. Since this works across our versions, go ahead and change.

Otherwise we see:

=================================== FAILURES ===================================
_______________________ test_smooth_window_1d_dataarray ________________________

    def test_smooth_window_1d_dataarray():
        """Test smooth_window on 1D DataArray."""
        temperature = xr.DataArray(
            [37., 32., 34., 29., 28., 24., 26., 24., 27., 30.],
            dims=('time',),
>           coords={'time': pd.date_range('2020-01-01', periods=10, freq='H')},
            attrs={'units': 'degF'})

tests/calc/test_basic.py:712: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pandas/core/indexes/datetimes.py:1008: in date_range
    dtarr = DatetimeArray._generate_range(
/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pandas/core/arrays/datetimes.py:424: in _generate_range
    freq = to_offset(freq)
offsets.pyx:4730: in pandas._libs.tslibs.offsets.to_offset
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.

offsets.pyx:4842: FutureWarning
=========================== short test summary info ============================
FAILED tests/calc/test_basic.py::test_smooth_window_1d_dataarray - FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.
============ 1 failed, 1510 passed, 1 xfailed in 467.89s (0:07:47) =============

(see current nightly failure in #3268)

Description Of Changes

Checklist

Apparently with Pandas 2.2.0 (tested in rc0) freq='H' is deprecated, in
favor of freq='h'. Since this works across our versions, go ahead and
change.
@dopplershift dopplershift added Type: Maintenance Updates and clean ups (but not wrong) Area: Tests Affects tests labels Dec 22, 2023
@dopplershift dopplershift added this to the December 2023 milestone Dec 22, 2023
@dopplershift dopplershift requested a review from a team as a code owner December 22, 2023 21:24
@dopplershift dopplershift requested review from dcamron and removed request for a team December 22, 2023 21:24
@dopplershift dopplershift added the nightly-ci Trigger a build of the nightly CI label Dec 22, 2023
@dcamron dcamron merged commit e0e24d5 into Unidata:main Dec 22, 2023
41 checks passed
@dopplershift dopplershift deleted the pandas-warning branch December 22, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tests Affects tests nightly-ci Trigger a build of the nightly CI Type: Maintenance Updates and clean ups (but not wrong)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly build is failing
2 participants