Skip to content

Conversation

@jbrockmendel
Copy link
Member

There is lots of code in core.internals inside try/except blocks, in particular calls to _try_coerce_args. It is tough to reason about these because it is often unclear what the raising cases are. This simplifies that problem by separating values, args = self._try_coerce_args(values, args) into values = self._coerce_values(values) and args = self._try_coerce_args(args) (Note the former doesnt have a "try" in the name because it never raises).

Also: removed a never-used ndim kwarg from Block.make_block and removed a now-redundant DatetimeTZBlock.copy method.

@jbrockmendel
Copy link
Member Author

@jorisvandenbossche CI fails look unrelated, ami missing something?

@jorisvandenbossche
Copy link
Member

@mroeschke mentioned those should be fixed by a commit in #27144 (comment)

@gfyoung gfyoung added Clean Internals Related to non-user accessible pandas implementation labels Jul 1, 2019
@jbrockmendel
Copy link
Member Author

yep, that fixed it, thanks.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. if you can fix the doc-strings (on the super class); ok to remove from the other _coerce_values.

return maybe_downcast_to_dtype(result, dtype)

def _try_coerce_args(self, values, other):
def _coerce_values(self, values):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible can you add types (ok for future PR) and full doc-strings


def _try_coerce_args(self, values, other):
def _coerce_values(self, values):
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can omit the doc-strings (as will inherit from super class)


def _try_coerce_args(self, values, other):
def _coerce_values(self, values):
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can omit doc-string

@jreback jreback added this to the 0.25.0 milestone Jul 1, 2019
@jreback
Copy link
Contributor

jreback commented Jul 2, 2019

lgtm. ping on green.

would really love a typing PR on blocks :->

@jbrockmendel
Copy link
Member Author

psuedo-ping. CI has been in this state for 13 hours

@TomAugspurger TomAugspurger merged commit 8507170 into pandas-dev:master Jul 2, 2019
@TomAugspurger
Copy link
Contributor

CI finished, seems like Github missed the notification.

FYI @jbrockmendel let me know if you want to be added to the azure team so you can restart builds. Just need an azure account name.

@jbrockmendel jbrockmendel deleted the try_coerce branch July 2, 2019 13:33
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants