Fix Type Annotation in pandas.core.accessor
State: closed

- [x] closes #26146
- [x] tests passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

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

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

```diff
@@            Coverage Diff             @@
##           master   #26147      +/-   ##
==========================================
- Coverage   91.99%   91.97%   -0.02%     
==========================================
  Files         175      175              
  Lines       52383    52378       -5     
==========================================
- Hits        48188    48177      -11     
- Misses       4195     4201       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.53% <100%> (-0.01%)` | :arrow_down: |
| #single | `40.71% <100%> (-0.17%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26147?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/accessor.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWNjZXNzb3IucHk=) | `98.8% <100%> (+0.01%)` | :arrow_up: |
| [pandas/util/\_doctools.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvX2RvY3Rvb2xzLnB5) | `0% <0%> (-12%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-8.56%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.9% <0%> (-0.12%)` | :arrow_down: |
| [pandas/core/arrays/interval.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2ludGVydmFsLnB5) | `93.06% <0%> (-0.06%)` | :arrow_down: |
| [pandas/core/indexes/interval.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9pbnRlcnZhbC5weQ==) | `95.22% <0%> (-0.03%)` | :arrow_down: |
| [pandas/core/arrays/sparse.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3NwYXJzZS5weQ==) | `92.3% <0%> (ø)` | :arrow_up: |
| [pandas/core/arrays/integer.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2ludGVnZXIucHk=) | `96.34% <0%> (+0.01%)` | :arrow_up: |
| [pandas/core/dtypes/dtypes.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2R0eXBlcy5weQ==) | `96.42% <0%> (+0.08%)` | :arrow_up: |
| [pandas/core/groupby/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/26147/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9vcHMucHk=) | `95.97% <0%> (+1.73%)` | :arrow_up: |

------

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

Can you double check remaining modules while at it to make sure this is current?
Ok, I will check all the modules in mypy.ini, but that will take some time. I will remove all unnecessary modules from mypy.ini by tomorrow, or add a comment here if there are none.
> 
> 
> Comment on annotation

@WillAyd Comment what on what. Sorry I didn't get what you actually mean.

> Can you double check remaining modules while at it to make sure this is current?

I am still checking the modules in `mypy.ini` for any unnecessary modules. I will be done tomorrow.
@WillAyd I found few more unnecessary modules in `mypy.ini`. I have commented them out so that you can take a look and also to make sure tests pass. I will remove them after tests pass.
@vaibhavhrt feel free to remove and fix up lint issue
@WillAyd all done. @jreback you can go ahead and merge this PR of everything looks ok to you.
thanks @vaibhavhrt