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

⚠️ Nightly upstream-dev CI failed ⚠️: pandas removed deprecated keyword arguments #7266

Closed
github-actions bot opened this issue Nov 8, 2022 · 12 comments · Fixed by #7444
Closed

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

Workflow Run URL

Python 3.10 Test Summary
xarray/tests/test_calendar_ops.py::test_convert_calendar[2 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_calendar_ops.py::test_convert_calendar_360_days[4 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_calendar_ops.py::test_convert_calendar_360_days[2 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_calendar_ops.py::test_convert_calendar_missing[2 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_calendar_ops.py::test_convert_calendar_same_calendar[1 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_calendar_ops.py::test_interp_calendar[4 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_calendar_ops.py::test_interp_calendar_errors[1 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_cftime_offsets.py::test_date_range[4 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_cftime_offsets.py::test_date_range_errors[1 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_cftime_offsets.py::test_date_range_like[5 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_cftime_offsets.py::test_date_range_like_same_calendar[1 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_cftime_offsets.py::test_date_range_like_errors[1 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_cftimeindex_resample.py::test_resample[486 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_cftimeindex_resample.py::test_calendars[5 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_computation.py::test_polyval_cftime[4 failing variants]: TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'
xarray/tests/test_groupby.py::TestDataArrayResample::test_resample[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_da_resample_func_args[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_resample_first[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_resample_bad_resample_dim[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_resample_drop_nondim_coords[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_resample_keep_attrs[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_resample_skipna[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample_nd[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample_tolerance[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample_interpolate[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample_interpolate_bug_2197[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample_interpolate_regression_1605[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDataArrayResample::test_upsample_interpolate_dask[2 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_and_first[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_min_count[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_by_mean_with_keep_attrs[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_loffset[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_by_mean_discarding_attrs[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_by_last_discarding_attrs[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_drop_nondim_coords[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_resample_ds_da_are_the_same[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::TestDatasetResample::test_ds_resample_apply_func_args[1 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_groupby.py::test_resample_cumsum[2 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_units.py::TestDataArray::test_resample[2 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
xarray/tests/test_units.py::TestDataset::test_resample[4 failing variants]: TypeError: Grouper.__init__() got an unexpected keyword argument 'base'
@github-actions github-actions bot added the CI Continuous Integration tools label Nov 8, 2022
@dcherian
Copy link
Contributor

dcherian commented Nov 9, 2022

Looks to be a result of https://github.com/pandas-dev/pandas/pull/49101/files

Seems like we have to change to origin or offset somewhere

@spencerkclark
Copy link
Member

spencerkclark commented Nov 9, 2022

Yes, I think so too. I can look into it more this weekend. Clearly we need to change the code that relies on pandas immediately. For resampling with a CFTimeIndex I may create a separate issue for implementing these new arguments (we can probably get those tests passing in the meantime, however).

@headtr1ck
Copy link
Collaborator

headtr1ck commented Nov 12, 2022

We also still have #6985 open.

Maybe we should try to catch Deprecation warnings in the nightly builds and raise an error / Automatic issue, so we can fix things before they break.

@spencerkclark
Copy link
Member

I went ahead and actually implemented the origin and offset options for the CFTimeIndex version of resample as part of #7284. It might be good to finish that and then we can decide how we would like to handle the deprecation.

Maybe we should try to catch Deprecation warnings in the nightly builds and raise an error / Automatic issue, so we can fix things before they break.

I agree -- something like that would be useful in general. In this particular case it seems like we were aware of it at one point, but just lost track after silencing it initially for compatibility reasons (#4292 (comment)). Unfortunately that means that this was silenced in user code as well.

@spencerkclark
Copy link
Member

Perhaps we can at least restore the warning in #7284 in case our next release happens to take place before the next pandas release to give users somewhat of a heads up. Apologies for being a bit out of the loop of #4292 at the time.

@keewis
Copy link
Collaborator

keewis commented Nov 13, 2022

maybe we can extend the action / create a new one to open one issue per unique deprecation message. However, for that we'd need to log the warnings in the reportlog output, which as far as I can tell pytest-reportlog does not support at the moment.

@keewis keewis changed the title ⚠️ Nightly upstream-dev CI failed ⚠️ ⚠️ Nightly upstream-dev CI failed ⚠️: pandas removed deprecated keyword arguments Nov 22, 2022
@keewis keewis removed the CI Continuous Integration tools label Nov 22, 2022
@keewis
Copy link
Collaborator

keewis commented Nov 22, 2022

we've got a few more errors now:

TypeError: DatetimeArray._generate_range() got an unexpected keyword argument 'closed'

I've renamed this issue to allow tracking more recent failures in new issues.

@spencerkclark
Copy link
Member

spencerkclark commented Dec 2, 2022

Should we add some sort of deprecation warning regarding the use of the base argument with future versions of pandas before the next release?

(I did not end up restoring the pandas warning in #7284)

@dcherian
Copy link
Contributor

dcherian commented Dec 2, 2022

Should we add some sort of deprecation warning regarding the use of the base argument with future versions of pandas before the next release?

That would be nice. It seems like we could also just do it in a later release?

@spencerkclark
Copy link
Member

Sorry I didn't get to adding the warning today. I'll try and put something together over the weekend so that it gets into the release after today's. I'm not sure exactly when pandas 2.0 will be out, but regardless I guess at least it could still be valuable for anyone who doesn't upgrade xarray and pandas at the same time.

@spencerkclark
Copy link
Member

As I think about this more, it wouldn't be too hard for us to support the base argument even after pandas removes it, so perhaps this isn't so urgent (at least as far as deprecation is concerned; we still need to make updates for compatibility, however). The code to translate a base argument to an offset argument can be found here, and is all possible with public API functionality. I already did something similar for the CFTimeIndex resampling code in #7284.

Maybe you were already thinking along those lines @dcherian.

@keewis
Copy link
Collaborator

keewis commented Mar 8, 2023

closed by #7444

@keewis keewis closed this as completed Mar 8, 2023
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 a pull request may close this issue.

4 participants