Skip to content
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

BUG: groupby.rank for dt64tz, period dtypes #38187

Merged
merged 6 commits into from
Dec 2, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Nov 30, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

This sits on top of #38162

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.

minor comment for followon

@@ -491,8 +491,11 @@ def _ea_wrap_cython_operation(
res_values, names = self._cython_operation(
kind, values, how, axis, min_count, **kwargs
)
if how in ["rank"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, this is prob not the best location for this longer term (eg.. we should have mappings from ops -> whether they should coerce back or not).

Copy link
Member Author

Choose a reason for hiding this comment

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

yah, we have something like that in the calling class. im in the process of moving all of this wrapping to the lowest level possible (which luckily coincides with it being in the fewest places possible), xref #37494 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Could this also be handled in maybe_cast_result_dtype? (which basically is somewhat implementing a mapping from ops -> expected dtype)

Copy link
Member Author

Choose a reason for hiding this comment

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

potentially, yah. this calls simple_new instead of from_sequence, which makes it a bit of an outlier.

there's also groupby.base.cython_cast_blocklist that i think is intended for something along these lines

@jreback jreback added the Groupby label Dec 2, 2020
@jreback jreback added this to the 1.2 milestone Dec 2, 2020
@jreback
Copy link
Contributor

jreback commented Dec 2, 2020

hmm, looks like CI is hanging, can you merge master and pin gon green.

@simonjayhawkins
Copy link
Member

hmm, looks like CI is hanging, can you merge master and pin gon green.

not merged master, but re-run an green

@jreback jreback merged commit 23cbc47 into pandas-dev:master Dec 2, 2020
@jbrockmendel jbrockmendel deleted the bug-rank branch December 2, 2020 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants