Skip to content

REF/CLN: ops boilerplate #23853

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

Open
2 of 4 tasks
jbrockmendel opened this issue Nov 22, 2018 · 2 comments
Open
2 of 4 tasks

REF/CLN: ops boilerplate #23853

jbrockmendel opened this issue Nov 22, 2018 · 2 comments
Labels
Clean Internals Related to non-user accessible pandas implementation Numeric Operations Arithmetic, Comparison, and Logical operations Refactor Internal refactoring of code

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Nov 22, 2018

A ton of comparison and arithmetic operations do something combination of:

  • other = lib.item_from_zerodim(other)
  • listlike but not arraylike --> wrap in ndarray
  • return NotImplemented if operating against a senior class
  • raise ValueError if there is a length mismatch

But we don't always do all of these, and we definitely don't use+test error messages as consistent as @gfyoung would like.

This behavior could all be collected+standardized in a decorator

@gfyoung gfyoung added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite Internals Related to non-user accessible pandas implementation Clean labels Nov 22, 2018
@gfyoung
Copy link
Member

gfyoung commented Nov 22, 2018

+1 for consistency. A decorator would be great, though that would be a little trickier to execute.

Also, for future reference, the reason for checking error messages in our tests is because those are important for end users when debugging code. Making sure that they're accurate is important, just as the type of error that is raised.

@jreback
Copy link
Contributor

jreback commented Nov 26, 2018

@jbrockmendel can you convert these to check boxes in the top (e.g. 4 would be checked by #23896 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation Numeric Operations Arithmetic, Comparison, and Logical operations Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants