-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: Fix interpolation on empty dataframe #35543
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
Changes from 5 commits
47bc7ba
2b17cb2
1676a43
5844c89
cf917b6
6b5245b
ad4eaa7
a44a4c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6807,6 +6807,9 @@ def interpolate( | |
|
||
obj = self.T if should_transpose else self | ||
|
||
if obj.empty: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would prefer that this happens in the internal method itself (called on L6861) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error happens before this call (on line 6825) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There were a few changes to interpolate in 1.1.0. will run git bisect to ascertain why this is now failing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a subtle change in #34752 where
was changed to
does reverting this change restore the old behaviour. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the regression is from #33084, but since the error message is about DataFrame columns, I don't think the above should have been changed either. @jbrockmendel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
As @sanderland notes, the check for all object dtype indeed happens here before calling into the internal method, so the check for empty thus also needs to happen here However, @sanderland I think the So I think we should explicitly check for no columns / no rows (alternatively could also add the check to the offending There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sanderland can you try @jorisvandenbossche suggestion here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I tried this in 1.0.x and it does not return a timedelta dtype, I dont see why interpolate would do this either. Could you suggest a test which fails with my approach but passes in 1.0.x? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, you're fully correct. I might have been mixing up the review of two PRs, as I was also reviewing a regression for Forget my comment! |
||
return self | ||
|
||
if method not in fillna_methods: | ||
axis = self._info_axis_number | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.