TYP: Adding absolute imports for pandas.core.reshape
State: closed

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


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

Comments:
Removed concat and tile from mypy.ini. I've not made any changes to imports for merge module due to issue mentioned in #25934 regarding pandas._libs
Is that failing for you locally? Curious if you are able to investigate root cause
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25936?src=pr&el=h1) Report
> Merging [#25936](https://codecov.io/gh/pandas-dev/pandas/pull/25936?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/de3a85c8404505ace0c0febc26b1fbe824f48034?src=pr&el=desc) will **decrease** coverage by `49.9%`.
> The diff coverage is `100%`.

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

```diff
@@             Coverage Diff             @@
##           master   #25936       +/-   ##
===========================================
- Coverage   91.81%   41.91%   -49.91%     
===========================================
  Files         175      175               
  Lines       52580    52592       +12     
===========================================
- Hits        48278    22044    -26234     
- Misses       4302    30548    +26246
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `41.91% <100%> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25936?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/reshape/tile.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS90aWxlLnB5) | `15% <100%> (-82.68%)` | :arrow_down: |
| [pandas/core/reshape/concat.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9jb25jYXQucHk=) | `44.88% <100%> (-52.32%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29udmVydGVyLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `0% <0%> (-99.36%)` | :arrow_down: |
| [pandas/core/groupby/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9jYXRlZ29yaWNhbC5weQ==) | `0% <0%> (-95.46%)` | :arrow_down: |
| [pandas/io/sas/sas7bdat.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXM3YmRhdC5weQ==) | `0% <0%> (-91.16%)` | :arrow_down: |
| [pandas/io/sas/sas\_xport.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfeHBvcnQucHk=) | `0% <0%> (-90.1%)` | :arrow_down: |
| ... and [132 more](https://codecov.io/gh/pandas-dev/pandas/pull/25936/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25936?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/25936?src=pr&el=footer). Last update [de3a85c...86266de](https://codecov.io/gh/pandas-dev/pandas/pull/25936?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/25936?src=pr&el=h1) Report
> Merging [#25936](https://codecov.io/gh/pandas-dev/pandas/pull/25936?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a07ed594ec6a5befc967fb1b18244bbeb3bc2bf1?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #25936      +/-   ##
==========================================
- Coverage    91.9%   91.89%   -0.01%     
==========================================
  Files         175      175              
  Lines       52485    52485              
==========================================
- Hits        48234    48230       -4     
- Misses       4251     4255       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.45% <ø> (ø)` | :arrow_up: |
| #single | `40.75% <ø> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25936?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/25936/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/25936/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/25936?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/25936?src=pr&el=footer). Last update [a07ed59...87a8ea4](https://codecov.io/gh/pandas-dev/pandas/pull/25936?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

> Is that failing for you locally? Curious if you are able to investigate root cause

No I didn't run any test locally - i can try and report back if that helps
Just tried running tests locally with importing `join` from `pandas._libs` in `merge` module - seems to be running ok but not sure if it will throw an error when checks run on pushing. 
Gotcha. Yea I’m sure there’s another way then just need to learn more about the import machinery

Sent from my iPhone

> On Mar 31, 2019, at 9:00 AM, Jeff Reback <notifications@github.com> wrote:
> 
> @jreback commented on this pull request.
> 
> In pandas/core/reshape/tile.py:
> 
> >  import pandas.core.algorithms as algos
> +from pandas.core.arrays.categorical import Categorical
> i was thinking just for frame / series but now i see for everything
> 
> this is pretty jarring - is there anyway to do this w/o going all the way here?
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.

@WillAyd @jreback Does this need any further updates ?
Similar comment in the other issue - right now keeping focus on typing so if it works by just removing blacklist items let's stick to that.

Certainly don't want to import numpy from the pandas namespace
ok just reverted the changes now
@ryankarlos looks OK and doubt CI failures are related but can you merge master and repush?

FYI merging master is strongly preferred to rebasing and shouldn't require a force push. Your workflow should look something like this on your local branch:

```sh
git fetch upstream
git merge upstream master
# Fix up merge conflicts if any
# git merge --continue
git push origin YOUR_BRANCH
```
@WillAyd @jreback Just merged master and re-pushed - but not sure why tests fail for linux py36 and py37 -- difficult to discern root cause from error log - maybe due to something unrelated ?
Test failures were unrelated and disappeared on restart of CI. This is pretty stripped down from original request and looks good so moving forward with merge.

Thanks @ryankarlos