-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: Exception in pd.plotting #28350
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
Conversation
return pprint_thing(data.index[i]) | ||
except Exception: | ||
if i >= len(data.index): | ||
# TODO: is getting here indicative of a larger problem? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@datapythonista I think you've worked in this area recently, any idea if this is something to worry about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test (or example code) that ended up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't work in this exact part, but this seems reasonable. I'm assuming this only affects the values in the axis, and it removes the decimals if they are zero, right?
I'm wondering if instead of i == int(i)
it'd be better to use i.apply(float.is_integer)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had completely forgotten about float.is_integer; neat. But I don't think we in general have an apply
do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Do these Exceptions ever surface? And if so, do we have any coverage on these?
- Since it seems you're going through these, do we have a lint check for these? Perhaps we can use it to open up this effort to interested (starting) contributors.
With the exception of the "pragma: no cover" on 433, these code paths are all reached in the tests.
#28347 adds a check for
Most of the remaining cases are in apply/groupby/resample and are pretty nasty. I wouldn't recommend then for a newcomer. |
locs = self.raise_if_exceeds(dates.date2num(all_dates)) | ||
return locs | ||
except Exception: # pragma: no cover | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a change in behaviour? Is this tested? Or do you think this could never raise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the len
check I dont think can raise. the self.raise_if_exceeds
seems like the kind of thing that could raise, but I think thats a matplotlib method so I'll have to dig into that to find a failing case.
return pprint_thing(data.index[i]) | ||
except Exception: | ||
if i >= len(data.index): | ||
# TODO: is getting here indicative of a larger problem? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test (or example code) that ended up here?
Closing to clear the queue since large parts of this have unclear desired behavior. Before long I'll revisit to address only obvious pieces. |
No description provided.