API: Disallow dict as agg parameter during groupby
State: closed

Grouped, rolled, and resample `Series` / `DataFrames` will now disallow dicts / nested dicts respectively
as parameters to aggregation (was deprecated before).

xref #15931.

Labels:
name: Groupby
name: API Design
name: Deprecate
description: Functionality to remove in pandas
name: Clean

Comments:
Hello @gfyoung! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/base.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/core/base.py) !

 - There are no PEP8 issues in the file [`pandas/core/groupby/generic.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/core/groupby/generic.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/aggregate/test_aggregate.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/tests/groupby/aggregate/test_aggregate.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/aggregate/test_other.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/tests/groupby/aggregate/test_other.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_groupby.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/tests/groupby/test_groupby.py) !

 - There are no PEP8 issues in the file [`pandas/tests/test_resample.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/tests/test_resample.py) !

 - There are no PEP8 issues in the file [`pandas/tests/test_window.py`](https://github.com/gfyoung/pandas/blob/5e4474479efc0503625ef877b07e29259ad9dea4/pandas/tests/test_window.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=h1) Report
> Merging [#23393](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/62a15fa4071d0711b2b97771b981d527c1c4af10?src=pr&el=desc) will **decrease** coverage by `0.03%`.
> The diff coverage is `87.5%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/23393/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #23393      +/-   ##
==========================================
- Coverage   92.16%   92.13%   -0.04%     
==========================================
  Files         166      166              
  Lines       51224    51224              
==========================================
- Hits        47212    47194      -18     
- Misses       4012     4030      +18
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.56% <87.5%> (-0.04%)` | :arrow_down: |
| #single | `42.22% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/groupby/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/23393/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9nZW5lcmljLnB5) | `86.77% <100%> (-0.27%)` | :arrow_down: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23393/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `93.8% <83.33%> (-3.81%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=footer). Last update [62a15fa...6caa3ea](https://codecov.io/gh/pandas-dev/pandas/pull/23393?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@jreback : Rebased and green. PTAL.
@jorisvandenbossche @TomAugspurger any objections. even though there is not a great soln to replace this, it is time.
I think this shouldn’t be enforced until we have a replacement in place. Rather we should update the warning to show the new style once that’s implemented, and give people a release to update. 
Yes, IMO we should first work on the ideas discussed in https://github.com/pandas-dev/pandas/issues/18366. 

I am going to try to find some time for that the coming month, but other people looking at it is certainly welcome.
Ah, thanks for reminding me about #18366, in which case, I do agree that this error should wait...

Where does `0.25` fit into deprecation removals though? (I see only targets for `1.0` in #6581)
AFAIK, the current plan is to deprecate everything in 0.24, not remove
anything in 0.25, and have 1.0 be backwards-compat with 0.25 aside from the
removals of deprecated features.

The idea is for people to upgrade 0.25, fix warnings, and then get on 1.0
relatively easily.

On Sun, Oct 28, 2018 at 2:08 PM gfyoung <notifications@github.com> wrote:

> Ah, thanks for reminding me about #18366
> <https://github.com/pandas-dev/pandas/issues/18366>, in which case, I do
> agree that this error should wait...
>
> Where does 0.25 fit into deprecation removals though? (I see only targets
> for 1.0)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/23393#issuecomment-433732637>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIkrqOAzXvD6b9-poqamTFFXHLAOIks5upgC8gaJpZM4X9vAu>
> .
>

Gotcha.  In that case, I'll move this deprecation removal to `1.0`.