Skip to content

Groupby transform cleanups #27467

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

Merged
merged 47 commits into from Jul 25, 2019
Merged

Groupby transform cleanups #27467

merged 47 commits into from Jul 25, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jul 19, 2019

  • whatsnew

Related #27389 (several issues there)
closes #27486

@pep8speaks
Copy link

pep8speaks commented Jul 19, 2019

Hello @pilkibun! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-07-25 18:18:14 UTC

@ghost ghost marked this pull request as ready for review July 19, 2019 14:56
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Mostly stylistic comments

def test_transform_invalid_name_raises():
df = DataFrame(dict(a=[0, 1, 1, 2]))
g = df.groupby(["a", "b", "b", "c"])
with pytest.raises(ValueError, match="not a valid function name"):
Copy link
Member

Choose a reason for hiding this comment

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

Can you parametrize these instead?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think that's needed. Parameterize with one case is not useful, and as a smoke test there doesn't need to be more than one. Also lots of similar tests in this file.

@TomAugspurger
Copy link
Contributor

Can you write release notes for each of the user-facing changes? If you merge master we should have a 0.26.0.rst now.

@jreback
Copy link
Contributor

jreback commented Jul 21, 2019

this also needs a whatsnew note. I am not so concerned about the invalid case (e.g. .transform('foo')), but something that looked legitimate and maybe even did something, though it may have been wrong, is now raising

pilkibun added 12 commits July 21, 2019 23:02
…leanups1

* origin/master:
  BUG: Fix inserting of wrong-dtyped NaT, closes #27297 (#27311)
  BUG: Retain tz transformation in groupby.transform (#27510)
  remove references to v0.19 in docs and code (#27508)
  remove last references to v0.18 in docs and code (#27507)
  CLN: avoid runtime imports (#27461)
…leanups1

* origin/master:
  xfail to fix CI (#27536)
  REF: de-privatize dtypes.concat functions (#27499)
  stop conflating iNaT with td64-NaT (#27411)
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.

looks really good! just some small comments. ping on green.

@jreback jreback added this to the 1.0 milestone Jul 24, 2019
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. not sure what is failing, merge master and ping on green. (you can ignore the codecov)

pilkibun added 2 commits July 25, 2019 13:16
…leanups1

* origin/master: (33 commits)
  TYPING: add type hints to pandas\io\formats\printing.py (#27579)
  TYPING: Partial typing of Categorical (#27318)
  REF: collect indexing methods (#27588)
  API: Add entrypoint for plotting (#27488)
  REF: implement module for shared constructor functions (#27551)
  CLN: more assorted cleanups (#27555)
  CLN: pandas\io\formats\format.py (#27577)
  TYPING: some type hints for core.dtypes.common (#27564)
  DEPR: remove .ix from tests/indexing/multiindex/test_ix.py (#27565)
  DEPR: remove .ix from tests/indexing/test_partial.py (#27566)
  TST: add regression test for slicing IntervalIndex MI level with scalars (#27572)
  DEPR: remove .ix from tests/indexing/multiindex/test_setitem.py (#27574)
  BUG: display.precision of negative complex numbers (#27511)
  Removed ABCs from pandas._typing (#27424)
  DEPR: remove .ix from tests/indexing/test_indexing.py (#27535)
  BUG: fix+test quantile with empty DataFrame, closes #23925 (#27436)
  BUG: maybe_convert_objects mixed datetimes and timedeltas  (#27438)
  more type hints for io/formats/format.py (#27512)
  CLN: simplify join take call (#27531)
  BUG: Allow ensure_index to coerce nan to NaT with numpy object array and tz Timestamp (#27556)
  ...
@ghost
Copy link
Author

ghost commented Jul 25, 2019

@jreback green

@jreback jreback merged commit eeb264c into pandas-dev:master Jul 25, 2019
@jreback
Copy link
Contributor

jreback commented Jul 25, 2019

thanks @pilkibun

@ghost ghost deleted the groupby_transform_cleanups1 branch July 25, 2019 22:53
@ghost
Copy link
Author

ghost commented Jul 25, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Groupby.transform(name) should only accept valid names
4 participants