BUG-24408 Series.dt does not maintain own copy of index
State: closed

- [X] closes #24408
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry

Previously, the `dt` accessor maintains its own copy of the index, so in-place operations would cause the indexes to be out of sync. This PR changes the accessor so it just gets the index from its parent.

Labels:
name: Bug

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

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

```diff
@@            Coverage Diff             @@
##           master   #24426      +/-   ##
==========================================
+ Coverage    92.3%    92.3%   +<.01%     
==========================================
  Files         163      163              
  Lines       51954    51953       -1     
==========================================
  Hits        47957    47957              
+ Misses       3997     3996       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.71% <100%> (-0.01%)` | :arrow_down: |
| #single | `42.99% <33.33%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24426?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/accessors.py](https://codecov.io/gh/pandas-dev/pandas/pull/24426/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9hY2Nlc3NvcnMucHk=) | `91% <100%> (-0.09%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24426/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.84% <0%> (+0.09%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24426?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/24426?src=pr&el=footer). Last update [2a09706...d21a893](https://codecov.io/gh/pandas-dev/pandas/pull/24426?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/24426?src=pr&el=h1) Report
> Merging [#24426](https://codecov.io/gh/pandas-dev/pandas/pull/24426?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/19054855582572632f80e6d141edbd610f6eac82?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/24426/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24426?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24426      +/-   ##
==========================================
- Coverage    92.3%    92.3%   -0.01%     
==========================================
  Files         163      163              
  Lines       51966    51965       -1     
==========================================
- Hits        47967    47966       -1     
  Misses       3999     3999
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.71% <100%> (-0.01%)` | :arrow_down: |
| #single | `43% <33.33%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24426?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/accessors.py](https://codecov.io/gh/pandas-dev/pandas/pull/24426/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9hY2Nlc3NvcnMucHk=) | `91% <100%> (-0.09%)` | :arrow_down: |

------

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

lgtm. ping on green.
@jreback green
thanks!