STYLE: Sort tests/groupby imports GH23334
State: closed

Sort imports in `tests/groupby`.

- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
Hello @samcan! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/groupby/aggregate/test_aggregate.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/aggregate/test_aggregate.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/aggregate/test_cython.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/aggregate/test_cython.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/aggregate/test_other.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/aggregate/test_other.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/conftest.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/conftest.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_apply.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_apply.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_bin_groupby.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_bin_groupby.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_categorical.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_categorical.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_counting.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_counting.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_filters.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_filters.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_function.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_function.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_groupby.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_groupby.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_grouping.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_grouping.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_index_as_string.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_index_as_string.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_nth.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_nth.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_rank.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_rank.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_timegrouper.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_timegrouper.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_transform.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_transform.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_value_counts.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_value_counts.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_whitelist.py`](https://github.com/samcan/pandas/blob/254af7073e9fb77701ac9dd53b6872acadaea672/pandas/tests/groupby/test_whitelist.py) !


can you merge master, we just updated the isort cfg
I'm going to take a look at this tomorrow afternoon (about 4pm -800)
can you rebase and fixup
Looking at now
I've remerged the master from https://pandas.pydata.org/pandas-docs/stable/contributing.html#updating-your-pull-request but when I try to rebase my commits into one, I can't find my original commit. If I try to push my new commit to the branch tests-groupby-sorted it says the update was rejected because the tip of the current branch is behind the remote counterpart. I'm not sure where to go from here.
And to clarify, (from Note about Fast-forwards at the git-push documentation) it appears that the issue is that development has proceeded on a different commit, so my commit needs to integrate data from that commit before my commit can be merged back into master. But I don't know then why fetching the upstream master wouldn't have done that.
you can just merge master and push
you don’t need to squash 
But without trying to squash, it's still saying my current branch is behind. Again, this is from https://pandas.pydata.org/pandas-docs/stable/contributing.html#updating-your-pull-request

```
> git fetch upstream

> git merge upstream/master
Already up to date.

> git push origin tests-groupby-sorted
To https://github.com/samcan/pandas
 ! [rejected]            tests-groupby-sorted -> tests-groupby-sorted (non-fast-forward)
error: failed to push some refs to 'https://github.com/samcan/pandas'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```

I added `--force` to get it to run:
```

>git push --force origin tests-groupby-sorted
Enumerating objects: 1344, done.
Counting objects: 100% (1344/1344), done.
Delta compression using up to 4 threads
Compressing objects: 100% (386/386), done.
Writing objects: 100% (995/995), 334.78 KiB | 6.83 MiB/s, done.
Total 995 (delta 825), reused 716 (delta 609)
remote: Resolving deltas: 100% (825/825), completed with 324 local objects.
To https://github.com/samcan/pandas
 + 254af7073...4870a412f tests-groupby-sorted -> tests-groupby-sorted (forced update)
```

But I'm nervous about doing so because the docs say it can lose commit history. Would that only be in my branch?

Thank you,
if you rebase then you need to force push; the point is to overwrite history
you can alternately simply merge master and push (this is the official workflow in the docs)
it doesn’t matter at the end of the day as when merged your PR will be squashed anyhow


closing as stale. would take PR's that fix style though.