#25942 Added ArrayLike and Dtype to pandas._typing
State: closed

- [x] closes #25942
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:
name: Typing
description: type annotations, mypy/pyright type checking

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

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

```diff
@@            Coverage Diff             @@
##           master   #25943      +/-   ##
==========================================
- Coverage   91.81%   91.81%   -0.01%     
==========================================
  Files         175      175              
  Lines       52580    52587       +7     
==========================================
+ Hits        48278    48281       +3     
- Misses       4302     4306       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.37% <100%> (ø)` | :arrow_up: |
| #single | `41.9% <100%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25943?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `98.34% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `92.19% <100%> (ø)` | :arrow_up: |
| [pandas/\_typing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL190eXBpbmcucHk=) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25943?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/25943?src=pr&el=footer). Last update [de3a85c...0761dab](https://codecov.io/gh/pandas-dev/pandas/pull/25943?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/25943?src=pr&el=h1) Report
> Merging [#25943](https://codecov.io/gh/pandas-dev/pandas/pull/25943?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/de3a85c8404505ace0c0febc26b1fbe824f48034?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25943      +/-   ##
==========================================
+ Coverage   91.81%   91.83%   +0.01%     
==========================================
  Files         175      175              
  Lines       52580    52524      -56     
==========================================
- Hits        48278    48236      -42     
+ Misses       4302     4288      -14
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.39% <100%> (+0.02%)` | :arrow_up: |
| #single | `40.72% <100%> (-1.25%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25943?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `98.34% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `92.2% <100%> (+0.01%)` | :arrow_up: |
| [pandas/\_typing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL190eXBpbmcucHk=) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/io/clipboard/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NsaXBib2FyZC9fX2luaXRfXy5weQ==) | `39.21% <0%> (-17.65%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/io/clipboard/clipboards.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NsaXBib2FyZC9jbGlwYm9hcmRzLnB5) | `18.51% <0%> (-12.35%)` | :arrow_down: |
| [pandas/util/\_decorators.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX2RlY29yYXRvcnMucHk=) | `91.34% <0%> (-0.17%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |
| [pandas/io/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NvbW1vbi5weQ==) | `91.83% <0%> (-0.05%)` | :arrow_down: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `91.72% <0%> (-0.02%)` | :arrow_down: |
| ... and [36 more](https://codecov.io/gh/pandas-dev/pandas/pull/25943/diff?src=pr&el=tree-more) | |

------

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

Ah yea makes sense

Sent from my iPhone

> On Apr 2, 2019, at 5:43 AM, Jeff Reback <notifications@github.com> wrote:
> 
> @jreback commented on this pull request.
> 
> In pandas/_typing.py:
> 
> >  
> +import numpy as np
> +
> +from pandas.core.dtypes.dtypes import ExtensionDtype
> +from pandas.core.dtypes.generic import ABCExtensionArray
> +
> +ArrayLike = Union[ABCExtensionArray, np.ndarray]
> +Dtype = Union[str, np.dtype, ExtensionDtype, Type]
> @WillAyd Type is correct here or Type[int, float, object], not actul instances as indicated by @gwrome
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.

thanks @gwrome