Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

jbrockmendel
Copy link
Member

No description provided.

return pprint_thing(data.index[i])
except Exception:
if i >= len(data.index):
# TODO: is getting here indicative of a larger problem?
Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member

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).

Copy link
Member Author

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?

@gfyoung gfyoung added Clean Error Reporting Incorrect or improved errors from pandas Visualization plotting labels Sep 9, 2019
Copy link
Member

@gfyoung gfyoung left a 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.

@jbrockmendel
Copy link
Member Author

Do these Exceptions ever surface? And if so, do we have any coverage on these?

With the exception of the "pragma: no cover" on 433, these code paths are all reached in the tests.

do we have a lint check for these?

#28347 adds a check for except:. Checking for Exception is harder because there are some cases where we can't make it any more specific.

Perhaps we can use it to open up this effort to interested (starting) contributors.

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
Copy link
Member

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?

Copy link
Member Author

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?
Copy link
Member

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?

@jbrockmendel
Copy link
Member Author

Closing to clear the queue since large parts of this have unclear desired behavior. Before long I'll revisit to address only obvious pieces.

@jbrockmendel jbrockmendel deleted the faster3 branch September 15, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Error Reporting Incorrect or improved errors from pandas Visualization plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants