BrandonFors/pandas-github-issues huggingface dataset:
CLN: Fix mypy error in 'pandas/tests/computation/test_eval.py'
State: closed

Added explicit typing annotation for _parsers: Dict[str, Type[BaseExprVisitor]]
Also added some import for Dict, Type and BaseExprVisitor

- [x] relates to #28926 
- [x] tests added / passed
- [x] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
Sure, thank you, Simon!
Thanks @immaxchen
CLN: Fix mypy errors in pandas/tests/io/test_sql.py Reverted and added type changes
State: closed

- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

ref closed PR #28979

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

Comments:
Thanks @aaditya-panik
fix is_scalar documentation (#28998)
State: closed

- [x] closes #28998
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

is_scalar documentation was wrong, see #28998

Labels:
name: Docs

Comments:
I was about to do the same... ^^
@WillAyd no harm in merging to master since this is going in 1.0.
Thanks @andreasbuhr!
DOC: 0.25.2 whatsnew cleanup
State: closed


Labels:
name: Docs

Comments:
Wait to merge this until https://github.com/pandas-dev/pandas/pull/28999 is in (fixing CI on 0.25.2).
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 0.25.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 19c8fad56aa3fc8f683e884f125f042143966b47
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #29000: DOC: 0.25.2 whatsnew cleanup'
```

4. Push to a named branch :

```
git push YOURFORK 0.25.x:auto-backport-of-pr-29000-on-0.25.x
```

5. Create a PR against branch 0.25.x, I would have named this PR:

> "Backport PR #29000 on branch 0.25.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
I'll do the manual backport.
CLN: Type error fix in tests\tseries\offsets\test_yqm_offsets.py
State: closed

- [ ] xref #28926
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
Alright! Sorry for the mess. Still learning how this git really works ;)
Merging master should fix the CI errors.
Did I do something wrong?
> Did I do something wrong?

No, the 3.8 build is just flaky.  I restarted it, so hopefully this will be green in a bit.
Great thanks @lukasbk
CLN: tests/extension/json/test_json.py typefix
State: closed

The error is due to the fact that the builtins.staticmethod type defined in extension.base.base.BaseExtensionTests does not match the function type in extension.json.test_json.BaseJSON. I don't see a possibility for a proper type hint fix without changing the structure of the code. One way would be to replace the call of staticmethod by function definitions that call the corresponding methods.
Here I propose an easier suppression of the error using type: Any.
What do you think?

- [ ] xref #28926
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
@lukasbk can you rebase
Hello @lukasbk! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:























There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-12-15 18:57:28 UTC
@lukasbk looks like a merge conflict; can you fix up and address comments?
looks ok to me. I am bit concerned that we are now changing back to using ``tm`` as we *do* want the ability to override on these tests, but I guess that mypy will check this now.
can you rebase
@lukasbk can you fix up the merge conflict? I think we can get this in if so
@lukasbk the CI didn't pass, and this is conflicting again.

Do you mind merging master again, making sure the CI passes, and pinging us to get this merged quickly after that please? Thanks!
@lukasbk can you fix up merge conflict? I think this was close
closing as stale. cc @SaturnFromTitan
ENH: Informative dtype message for for assert_series_equal
State: closed

Pass obj to assert_attr_equal in assert_series_equal.

- [ ] closes #28991
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
- [x] Fix example in `assert_frame_equal` docstring

Labels:
name: Testing
description: pandas testing functions or related to the test suite

Comments:
Which whatsnew do I have to change?
If there's nothing user-facing, you dont need a whatsnew entry
OK thanks! Then this pull request should be ready to merge.
can you merge master. ping when all green.
@moi90 can you rebase?  the CI failures should be fixed now
thanks @moi90 
You're welcome!
tests/indexing/test_coercion.py typefix
State: closed

- [ ] xref #28926
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
Thanks @lukasbk
pandas-dev#28926 Mypy fix/extension json array
State: closed

ref: #28926
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


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

Comments:
@aaditya-panik are you still working on this? Looks like there are a final few comments to address
Looks like this has gone stale so closing for now but ping if you'd like to pick back up and address comments
mypy typing issues for decimal pandas/tests/extension/decimal/test_decimal.py
State: closed

- [ ] xref #28926
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
@simonjayhawkins am i right in thinking that the `# type: ignore` this uses is something were trying pretty hard to avoid?
> @simonjayhawkins am i right in thinking that the `# type: ignore` this uses is something were trying pretty hard to avoid?

correct.
@yogendrasoni is this still active?
closing as stale, if you'ld like to continue, pls ping.
CLN: Add type hinting to base classes (#28926)
State: closed

- [x] partially addresses #28926
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [N/A] whatsnew entry


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

Comments:
Linked/Duplicate PR #28979
Ah, I'm sorry @aaditya-panik, thought I checked everything that someone was already working on...
No worries @jjlkant, just added the comment to link the two PRs so that it's easy for the maintainers to discuss if needed 😄 
Will close this pull request, probably will be implemented using the continuation from https://github.com/pandas-dev/pandas/pull/28979#pullrequestreview-301909855
Mypy fix/io sql
State: closed

- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

As part of this PR, did the following:

* Variable typing.
* Code cleanup and reformatting the imports.
* Internal class `_TestSQLAlchemyConn` behaves like an abstract class.
* To solve **variable name clashing** between parent classes in some of the errors, I restructured the inheritance from a structure like 

  > (_TestSQLAlchemy, _TestDBSQLAlchemy) --> TestDBSQLAlchemy

  to

  > _TestSQLAlchemy --> _TestDBSQLAlchemy --> TestDBSQLAlchemy

  Not sure why it was like that unless I'm missing something?

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: IO SQL
description: to_sql, read_sql, read_sql_query
name: Compat
description: pandas objects compatability with Numpy or Python functions
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
I will be creating and linking a new PR because I think I botched my forked repo branch. Will link the two PRs once I create the new one with the changes @simonjayhawkins suggested.
@simonjayhawkins made the changes you suggested. Let me know if that works.
CLN: remove unnecessary get_value_at calls
State: closed

I found in another branch that these calls didn't play nicely with `nogil`, so went through and removed the ones that are unnecessary.  Turns out we really only need the one in libindex.get_value_at, since that is the only place where we _arent_ assured that `loc` is intlike.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
thanks any perf implications?
> thanks any perf implications?

Not yet, but I think this will allow us to `nogil` some functions that we couldn't before, so possibly there
Fix mypy error message in `pandas/tests/indexes/test_numeric.py` …
State: closed

Use Optional to signal that the value may be either an `Index` or `None`.

- [X] Relates to #28926
- [X] tests added / passed
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
You'll have to rerun the CI.
Tests passed, rebasing on top of `master` squashing my fixup...

P.S. Thanks for the label, completely forgot about it! 😃 
@GrigoriosGiann Thanks for the PR. This partly overlaps with #28961. will revisit this once #28961 merged.
overlaps with #28961
CLN: pandas-dev#28926 Fix mypy errors in pandas/tests/io/parser/conftest.py
State: closed

- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


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

Comments:
Thanks @aaditya-panik
CLN: pandas-dev#28926 Fix pandas/tests/tseries/offsets/test_offsets_properties
State: closed

…/teset_offsets_properties.py

- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


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

Comments:
Thanks @aaditya-panik
fix #28926 mypy error in pandas\tests\arrays\test_array.py 
State: closed

- [ ] xref #28926
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
lgtm @simonjayhawkins 
Was (accidentally) also looking into this fix. However, I believe this is also the fix for:
* _pandas\tests\arrays\test_period.py_
```bash
pandas\tests\arrays\test_period.py:245: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
```
* _pandas\tests\test_base.py_
```bash
pandas\tests\test_base.py:1312: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\test_base.py:1354: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
```

This implies the entries for both of these files should also be removed from setup.cfg
@yogendrasoni in merging master the section in setup.cfg for pandas\tests\arrays\test_period.py was reinstated. can you remove.
Thanks @yogendrasoni
Fix mypy errors for pandas\tests\*:  test_convert_to.py
State: closed

- [x ] xref #28926
- [x ] tests added / passed
- [x ] passes `black pandas`
- [x ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [N/A ] whatsnew entry


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

Comments:
btw @WillAyd @simonjayhawkins feel free to merge mypy fixes when you guys are satisfied (generally)
Thanks @lrm25
TST: added test for df.loc modify datetime columns
State: closed

relevant GitHub issue #28837

- [x] closes #28837 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
@mroeschke @simonjayhawkins 
Please review
Hello @rohitsanj! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-10-29 04:56:10 UTC
@mroeschke Hey, I realised I hadn't written the test case properly. I've updated it now. Can you check it out?
Thanks for the commit @gfyoung
Thanks @rohitsanj, @gfyoung!
CLN: fix mypy errors in pandas\tests\indexes\interval\test_base.py #28926
State: closed

- [ ] xref #28926
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Hi! I based this change on what I saw in #28947. However, when I test this with `mypy pandas/tests/indexes/interval/test_base.py`, I get this error, which I didn't expect:

```
pandas/tests/indexes/interval/test_base.py:16: error: Incompatible types in assignment (expression has type "Optional[Type[IntervalIndex]]", base class "Base" defined the type as "None")
```

I thought the "Optional" that was added would accept the "None." But, additionally, in my local environment, I also can't see any of the errors listed in issue #28926, so maybe I don't have something set up right.



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

Comments:
Hello @srcole! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-10-28 15:07:53 UTC
> also can't see any of the errors listed in issue #28926, so maybe I don't have something set up right.

to see the errors, you would need to comment out the ignore_errors in `setup.cfg`
I tested it locally, and it seems this change also fixes:

```
pandas\tests\indexes\test_numeric.py
pandas\tests\indexes\test_category.py
```

So I removed them from `setup.cfg`
@srcole can you rebase
Thanks for catching that @simonjayhawkins. Yup, I guess I missed that when addressing the merge conflict. Anyway, I removed that line.
Thanks @srcole !
Fix mypy errors for pandas\tests\* #28926 (test_algos.py)
State: closed

- [x] xref #28926
- [x] tests added / passed (verified that tests still pass)
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [N/A] whatsnew entry


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

Comments:
Thanks @lrm25 for the PR.
Nice find. Not sure this was even testing what was intended previously, so definitely speaks to annotations being useful for tests 
Thanks!
REF: re-raise AssertionError unchanged
State: closed

This should be all the remaining places where we catch `Exception` in groupby/apply/resample code.  This should make debugging much easier going forward.

cc @jreback @WillAyd 

Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
lgtm. pls rebase
rebased+green
Thanks @jbrockmendel
CLN: Consistent and Annotated Return Type of _iterate_slices
State: closed

General pre-cursor to getting block management out of groupby. This is also a pre-cursor to fixing #21668 but needs to be coupled with a few more changes as a follow up

On master calls to _iterate_slices look up by label, potentially yielding a DataFrame if there were duplicated columns. This takes the surprise out of that and simply returns a Tuple of label / series for each item along the axis

@jbrockmendel 

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

Comments:
Might want to look at DataFrameGroupBy._transform_item_by_item.  If I'm reading it correctly, that will screw up if we have non-unique columns.  (I think that's relevant to what you're doing here)
> can u perf check for groupby

Ran entire GroupBy benchmark and showed no changes

> Might want to look at DataFrameGroupBy._transform_item_by_item

Yea looks it could be consolidated to use this, though leaving to a follow up

Also w.r.t. your comment on axis=1 case seems logical but might be some complications around managing selection state with that and how things are constructed. May take a look down the road, though if you see a way to make it work in the meantime makes sense to me

thanks
CLN: Clean DirNameMixin._deprecated
State: closed

This moves the content of ``DirNameMixin._deprecations`` to more appropriate locations, typically ``IndexOpsMixIn._deprecations``, as that is a common subclass of ``Index`` and ``Series``. The names in ``DirNameMixin._deprecations`` belonged to those two classes, so having the deprecated names located all the way up in ``DirNameMixin`` made them be available in all classes that subclass ``DirNameMixin``, which was unfortunate.

By having ``DirNameMixin._deprecations`` start with an empty set, it will be easier to use
``DirNameMixin`` and ``PandasObject`` where/when needed, without inheriting undesired names in ``_deprecated``.

This PR also moves ``"tolist"`` to ``IndexOpsMixIn._deprecations``, because ``tolist`` is defined in that class.


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

Comments:
Thanks @topper-123
To string with encoding
State: closed

- [x] close #28766
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Enhancement
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
can you merge master
@simonjayhawkins  please have a look.
Hi the CI is failing for reasons I do not understand. https://travis-ci.org/pandas-dev/pandas/jobs/600239741 
It says 

> No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself
Hi @WillAyd @jreback can you please review.
lgtm. merge when @WillAyd and @simonjayhawkins good.
@WillAyd updated the branch with the required changes, please have a look.
Thanks @farziengineer 
Thanks @simonjayhawkins  @WillAyd for all the reviews.
Change width of specific columns using col_space param in df.to_html
State: closed

DataFrame.to_html col_space parameter to change width of a specific column only

- [ ] closes #28917 
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:

Comments:
Hello @SRIRAM777! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



* In the file [`pandas/io/formats/html.py`](https://github.com/pandas-dev/pandas/blob/ad98e6b737f295362b33e2f8efa31f790e1d662d/pandas/io/formats/html.py):

> [Line 128:89](https://github.com/pandas-dev/pandas/blob/ad98e6b737f295362b33e2f8efa31f790e1d662d/pandas/io/formats/html.py#L128): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (99 > 88 characters)
> [Line 130:89](https://github.com/pandas-dev/pandas/blob/ad98e6b737f295362b33e2f8efa31f790e1d662d/pandas/io/formats/html.py#L130): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (92 > 88 characters)


@SRIRAM777 there is already a PR for this, see #28929.
> @SRIRAM777 there is already a PR for this, see #28929.

Hi @simonjayhawkins Since you had requested to avoid the usage of an additional argument in that PR, I thought of utilizing the existing argument col_space to accept dict values like {'col1':25,'col2':50} to handle column width for specific columns. I'm new to open source contribution. Am I not supposed to raise another PR when there's already one?
we don't encourage competing PRs. The other PR is not stale. The OP is awaiting some clarification on the requirements. If you could review that PR and make suggestions, that'll be great.
> we don't encourage competing PRs. The other PR is not stale. The OP is awaiting some clarification on the requirements. If you could review that PR and make suggestions, that'll be great.

@simonjayhawkins Sorry about that. So, should I close this one? 
> So, should I close this one?

for now, that's probably best.

Thanks for taking the time to look into this.
WEB: Adding new pandas logo
State: closed

- [X] closes #21376, xref #28521
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

![logo_screenshot](https://user-images.githubusercontent.com/10058240/66708951-9ae55280-ed1f-11e9-9621-b482a3af345c.png)



Labels:
name: Web
description: pandas website

Comments:
nice!
Do we also have the font of the logo?
It's from Adobe, can be downloaded from their web. I'm in my phone now, but can send the link later.
The font is the bold version of this one: https://fonts.adobe.com/fonts/mr-eaves-xl
I don't know much about fonts and licensing etc, but something I am wondering: should we rather use an open source font? (try to find something that resembles this font)

The logo with the Adobe font is free to use (even for commercial logo's), but to create the logo you still need a license, as far as I understand (https://helpx.adobe.com/fonts/using/font-licensing.html#act-own):

> ... if your client needs to have the font installed to edit your design, they will need their own license

I don't exactly know what those licenses are, or if that is included in free plans or so, though
I assume the designer has a license for the font (I guess it comes with whatever software she uses). And the logo file is not using the font, the letters has been converted to paths.

I don't see any problem, but I'm happy to get you in touch with the designer, you can discuss any concern with her, and if you prefer a new logo with another font, happy to hand over this to you.
CLN: fix mypy errors in pandas/tests/extension/test_numpy.py #28926
State: closed

- [ ] xref #28926 
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


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

Comments:
does this also fix the errors in `pandas\tests\extension\test_sparse`
Great thanks @lukasbk !