FIX: Allow aggregate to return dictionaries again #16741
State: closed

Fixes a regression from 0.19 to 0.20. The function passed to `aggregate` is allowed again to return dictionaries.
 
- [X] closes #16741
- [X] tests added / passed, added `test_cython_agg_return_dict`
- [X] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
- [X] whatsnew entry


Labels:
name: Bug
name: Groupby
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=h1) Report
> Merging [#16752](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/18f7b1ccee1c723cac7f23a16099d08c17ed0a91?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #16752      +/-   ##
==========================================
+ Coverage   90.93%   90.93%   +<.01%     
==========================================
  Files         161      161              
  Lines       49282    49282              
==========================================
+ Hits        44815    44816       +1     
+ Misses       4467     4466       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.7% <ø> (ø)` | :arrow_up: |
| #single | `40.17% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.33% <0%> (+0.09%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16752?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/16752?src=pr&el=footer). Last update [18f7b1c...0fd94fb](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=h1) Report
> Merging [#16752](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/18f7b1ccee1c723cac7f23a16099d08c17ed0a91?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #16752      +/-   ##
==========================================
+ Coverage   90.93%   90.93%   +<.01%     
==========================================
  Files         161      161              
  Lines       49282    49282              
==========================================
+ Hits        44815    44816       +1     
+ Misses       4467     4466       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.7% <ø> (ø)` | :arrow_up: |
| #single | `40.17% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.33% <0%> (+0.09%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16752?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/16752?src=pr&el=footer). Last update [18f7b1c...aac0331](https://codecov.io/gh/pandas-dev/pandas/pull/16752?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks!