Skip to content

BUG: avoid incorrectly inheriting result #27445

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 1 commit into from

Conversation

jbrockmendel
Copy link
Member

This has caused problems in a number of local branches, but I don't have a good test case on master. Suggestions welcome. Still though, the failure mode is pretty clear, so this fixes it.

@WillAyd
Copy link
Member

WillAyd commented Jul 19, 2019

Hmm not immediately apparent here but what problems does this fix?

@jbrockmendel
Copy link
Member Author

Hmm not immediately apparent here but what problems does this fix?

You're right that ATM this is a solution in search of a problem. This becomes necessary in the branch that is the follow-up to #27428 (which is itself a follow-up to #27411). I can close and re-open when it becomes actually necessary, but am hoping I can find a useful example in the interim, since the failure mode is clear.

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.

if you have a test for this would be best, but if you can revise sligthly can push thru

@@ -143,8 +143,12 @@ def _cython_agg_blocks(self, how, alt=None, numeric_only=True, min_count=-1):
new_blocks = []
new_items = []
deleted_items = []
no_result = object()
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't you just set result = None outside the try instead as its more clear

Copy link
Member Author

Choose a reason for hiding this comment

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

because I don't know for sure that None won't be the correct result produced on line 154

@@ -171,15 +175,16 @@ def _cython_agg_blocks(self, how, alt=None, numeric_only=True, min_count=-1):
except TypeError:
# we may have an exception in trying to aggregate
# continue and exclude the block
pass
deleted_items.append(locs)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we actually use the deleted_items?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, down on 195

@jreback jreback added the Dtype Conversions Unexpected or buggy dtype conversions label Jul 20, 2019
@jreback jreback added this to the 1.0 milestone Jul 20, 2019
@jbrockmendel
Copy link
Member Author

if you have a test for this would be best, but if you can revise sligthly can push thru

Yah, I'd rather leave this open for now until it becomes necessary (following #27428) or I can come up with a test.

@jreback
Copy link
Contributor

jreback commented Jul 20, 2019

if you have a test for this would be best, but if you can revise sligthly can push thru

Yah, I'd rather leave this open for now until it becomes necessary (following #27428) or I can come up with a test.

not averse but if we can't break the current code then maybe wait on this.

@jbrockmendel
Copy link
Member Author

Closing in favor of #27567, which includes this as a subset

@jbrockmendel jbrockmendel deleted the no_result branch July 26, 2019 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Groupby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants