Skip to content

ENH/ERR: More consistent error reporting with invalid win_type in rolling #38641

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

Merged
merged 11 commits into from
Dec 23, 2020

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Dec 22, 2020

Also in-lining methods that were only used once and moving a BaseIndexer test that was using win_type

@mroeschke mroeschke added this to the 1.3 milestone Dec 22, 2020
@mroeschke mroeschke added Error Reporting Incorrect or improved errors from pandas Window rolling, ewma, expanding labels Dec 22, 2020
@jreback jreback merged commit e7689c9 into pandas-dev:master Dec 23, 2020
@jreback
Copy link
Contributor

jreback commented Dec 23, 2020

thanks @mroeschke

@mroeschke mroeschke deleted the bug/strict_win_type branch December 29, 2020 02:56
@jorisvandenbossche
Copy link
Member

@mroeschke this seems to have broken dask (this PR, or one of the other recent rolling-related PRs, but from a quick look at the diff, I suspect this one)

AFAIU, the issue is that the Rolling object (returned from eg df.rolling("1s"), which is a public object) its win_type attribute changed in case of time-based windows. Before, this was set to r.win_type == "freq", but that's no longer the case.

@mroeschke
Copy link
Member Author

Gotcha, do you have a reference issue how dask was using win_type attribute?

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jan 4, 2021

Not yet opened an issue about it, but so this is the code where it is failing: https://github.com/dask/dask/blob/4a7a2438219c4ee493434042e50f4cdb67b6ec9f/dask/dataframe/rolling.py#L317-L326. So basically they used win_type == "freq" (self._win_type in dask is pandas' Rolling.win_type) to check if they have time-based rolling, and because that changed they now end up in a different if/else branch

The failure it is causing is eg https://github.com/dask/dask/runs/1644840945#step:5:4998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR: Most consistent error handling when passing win_type='freq' in rolling
3 participants