BrandonFors/pandas-github-issues huggingface dataset:
#25707 - Fixed flakiness in stata write test
State: closed

This is my first contribution, so please be gentle.
 
For future reference, this error occurs when the two files are written in different minutes. I couldn't break the comparison by feeding the test datetime objects that only changed the seconds, so I assume only the date, hours, and minutes, are encoded. 

Anyway, we can't pass `False` as a keyword argument for `time_stamp`. It defaults to `None`, which internally uses the current timestamp, but otherwise expects a datetime.

For testing purposes, it suffice to pass the same arbitrary timestamp as a keyword. That way it encodes the same timestamp into each file, regardless of when the test runs and how long it takes.

Instead of `False`, we could use a keyword argument like this: `{'time_stamp': pd.to_datetime('2019-01-01 00:00')}`


Labels:
name: Unreliable Test
description: Unit tests that occasionally fail
name: IO Stata
description: read_stata, to_stata

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25714?src=pr&el=h1) Report
> Merging [#25714](https://codecov.io/gh/pandas-dev/pandas/pull/25714?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/dcf7fce19a662a86a2892396472e052ab9f69708?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #25714   +/-   ##
=======================================
  Coverage   91.24%   91.24%           
=======================================
  Files         172      172           
  Lines       52967    52967           
=======================================
  Hits        48332    48332           
  Misses       4635     4635
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.82% <ø> (ø)` | :arrow_up: |
| #single | `41.74% <ø> (ø)` | :arrow_up: |


------

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

Thanks @gwrome! Nice job, and sorry about misleading you in the issue with the `time_stamp` argument type.
You're welcome, glad I could help!
Auto backport of pr 25701 on 0.24.x
State: closed

@TomAugspurger @jorisvandenbossche @jreback want to double check I did this right. I didn't use the -m flag during the cherry-pick process as that was causing failures

0.24.3 at this point?

Labels:
name: CI
description: Continuous Integration

Comments:
@WillAyd what was wrong is that the PR was not targetting the 0.24.x branch but master (I changed it now, but before it was showing a huge number of commits). 
So when you crate a PR, you can choose which branch you want to merge it in. Or after creating, if you do the "Edit" button next to the title, you can still change it.

But so now with targetting 0.24.x branch, this looks fine.

I typically use `git cherry-pick -x <sha>`
@jorisvandenbossche thanks yea that did look off so thanks for fixing and clarifying. 
@WillAyd this should be merged or closed?
@jreback I think OK to merge
Thanks!
Add obj=obj to get it in failing assert messages
State: closed

Adding obj=obj in this call to assert_attr_equal helps make failing test cases more easily debuggable. This follows the pattern elsewhere in this same file of other calls to assert_attr_equal and related methods.

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:

Comments:
The Checks_and_doc errors seem to be for style violations in other files not touched in this PR: https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=9364
Apologies. I do see some test failures related to this change, e.g.:

AssertionError: Pattern 'Attributes are different' not found in 'DataFrame.iloc[:, 0] are different

Perhaps this example also suggests that the error messages will be more readable if they still mention "Attributes".

I will try to close this now and be more careful next time about running all the relevant tests.
BLD: validate_docstrings.py add ignore_known_fail argument
State: closed

- [ ] closes #25120 

a solution for the problem of inherited docstrings not passing docstring tests preventing errors to be added to the CI `code_checks.sh`


Labels:
name: Docs

Comments:
Might have missed some conversations but not sure I am on board with this change. Wouldn't it be easier to just update those docstrings on our end?
@WillAyd 
If I understand your proposal, I don't think it's easier for a couple of reasons. Firstly these docstrings inherited from the datetime library are not in the pandas library as a string, at least I can't grep them.
More importantly, editting them to adhere to GL01 and GL02 may seem trivial but editting them to adhere to the rest of the list of errors is not trivial and just strange. If we intend to eventually have the entire list of errors on `validate_docstrings.py` to be checked by the CI then it makes sense to be able to exempt inherited docstrings. For example, RT01 tests for a returns section in the docstring and then there are more tests about the returns section. (Introspection to check whether the docstring is inherited is another option that was considered but decided to be overkill).
This way presents its own problems, like having docstrings that are not very helpful and having to make sure not to add a docstring to the whitelist by mistake. Still, unless there is something I'm unaware of, it is a good way forward to get more docstring errors to be checked by CI.


Why don't we just exclude sphinx from generating doc pages for these attributes? Most of the docstrings for these don't really offer much value:

<img width="413" alt="image" src="https://user-images.githubusercontent.com/609873/55369431-66a8f380-54ab-11e9-98f3-5da662024923.png">

Seems simpler than adding complexity with this PR
Closing as stale though not sure this is the right approach anyway. If interested in continuing let's pick up conversation back in referenced issue
STY: use pytest.raises context manager (io.sql)
State: closed

xref #24332

Labels:
name: Refactor
description: Internal refactoring of code
name: Testing
description: pandas testing functions or related to the test suite
name: IO SQL
description: to_sql, read_sql, read_sql_query

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25597?src=pr&el=h1) Report
> Merging [#25597](https://codecov.io/gh/pandas-dev/pandas/pull/25597?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b72e7ed320de4d5b9aa8e0b7f2166cee2c7e6fdf?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #25597   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files         173      173           
  Lines       52966    52966           
=======================================
  Hits        48338    48338           
  Misses       4628     4628
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.83% <ø> (ø)` | :arrow_up: |
| #single | `41.71% <ø> (ø)` | :arrow_up: |


------

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

thanks @simonjayhawkins
BUG: support EAs in nargsort without warning
State: closed

Closes https://github.com/pandas-dev/pandas/issues/25439


Labels:
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
> Probably want a whatsnew?

There is no behaviour change, just the warning, so thought it might not be needed. But can certainly add one.
There is actually a broader issue here (also the reason that the tests are failing, eg IntervalArray.argsort is failing on data with NaNs): the `EA.argsort` API is not clearly defined (or not tested), and the check I edited here was originally specific for categorical data, so it also  assumed that NaNs would be sorted first (-1 in the codes). While in general, I think from an `argsort` method it is expected to sort them last.

Eg 

```
In [12]: pd.Categorical(['a', 'b', np.nan]).argsort()                   
Out[12]: array([2, 0, 1])

In [13]: pd.Categorical(['a', 'b', np.nan]).sort_values()                 
Out[13]: 
[a, b, NaN]
Categories (2, object): [a, b]
```

so in the above, `argsort` and `sort_values` have a different behaviour regarding missing values.


If we want to generalize this, this "sorting last" should be moved inside `Categorical.argsort`. But that would mean for the case where `core.sorting.nargsort` wants to put them first, you do this moving first/last twice (moving last inside Categorical.argsort, moving back first inside nargsort).
 
Unless we would add the `na_position` to the `EA.argsort` interface.
@TomAugspurger would you be fine with catching this specific warning in our code for 0.24.2 (because my explanation above has too much impact for 0.24.2)? 
Or what is the reason for objecting filtering the warning? It's certainly not good practice, but showing this warning is just plain confusing for users, as there is nothing they should do anything about.
Yeah, as a short-term fix that's fine.

On Sun, Mar 10, 2019 at 9:18 AM Joris Van den Bossche <
notifications@github.com> wrote:

> @TomAugspurger <https://github.com/TomAugspurger> would you be fine with
> catching this specific warning in our code for 0.24.2 (because my
> explanation above has too much impact for 0.24.2)?
> Or what is the reason for objecting filtering the warning? It's certainly
> not good practice, but showing this warning is just plain confusing for
> users, as there is nothing they should do anything about.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/25595#issuecomment-471310286>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIpfXQ3q-Jp8eEi3fI-md_00m2C-hks5vVRQ7gaJpZM4bjnoX>
> .
>

OK, opened https://github.com/pandas-dev/pandas/pull/25629 for that
can you merge master
superseded by #26354
minor typo error
State: closed

Changed from '**his** can be an expensive operation...' to '**this** can be an expensive operation...'


Labels:
name: Docs

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25574?src=pr&el=h1) Report
> Merging [#25574](https://codecov.io/gh/pandas-dev/pandas/pull/25574?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/3e652ac565e054b763ccbe23006c02704f6cd1b1?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #25574   +/-   ##
=======================================
  Coverage   91.26%   91.26%           
=======================================
  Files         173      173           
  Lines       52966    52966           
=======================================
  Hits        48337    48337           
  Misses       4629     4629
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.83% <ø> (ø)` | :arrow_up: |
| #single | `41.71% <ø> (ø)` | :arrow_up: |


------

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

Thanks!
DOC: Use correct pandas when building documentation
State: closed

This manifested itself in #25419 - when trying to build documentation the version of pandas that gets inserted into the globals of this module may have inadvertently been picked up from another install on the system. This prioritizes the version of pandas dictated by command line args

Labels:
name: Docs
name: CI
description: Continuous Integration

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

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

```diff
@@            Coverage Diff             @@
##           master   #25486      +/-   ##
==========================================
+ Coverage   91.75%   91.75%   +<.01%     
==========================================
  Files         173      173              
  Lines       52955    52955              
==========================================
+ Hits        48588    48589       +1     
+ Misses       4367     4366       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.32% <ø> (ø)` | :arrow_up: |
| #single | `41.72% <ø> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25486?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25486/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.66% <0%> (+0.09%)` | :arrow_up: |

------

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

Raises a ValueError when the input to to_datetime contains some numbers
but the unit isn't supplied.

- [X] closes #15836
- [ ] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: API Design

Comments:
Hello @samuelsinayoko! Thanks for updating the PR.



Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on February 27, 2019 at 20:35 Hours UTC
First part of any PR should be tests so please make sure to add them. Also looks like this introduced a slew of errors so be sure to run the suite locally before pushing to GH
Closing as stale - ping if you'd like to pick this back up and have tests
Correct a typo of version number for interpolate()
State: closed

Correct a typo of version number in the docstring of _shared_docs['interpolat e'] which is the docstring for pandas.core.resample.Resampler.interpolate, pandas.DataFrame.interpolate, panda s.Series.interpolate, and pandas.Panel.interpolate, and in documentation/user_guide/missing_data about the limit_area keyword argument in interpolate(). The reference can be found at https://github.com/pandas-dev/pandas/issue s/8000#issuecomment-465802842.






Labels:
name: Docs

Comments:
thanks
DOC: modify typos in Contributing section
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

I participated in an open source sprint day today. This is my first attempt to request a PR to contribute to open source. I made changes to fix a few minor typos.

Labels:
name: Docs

Comments:
@alyssafuward Thanks a lot!
Thank you for the support! This totally made my night!
@alyssafuward : Our pleasure!  We hope that you'll continue to contribute more to our repository (and to open source in general) in the future!
BUG: Series.__setitem__ with datetimetz data
State: closed

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


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Timezones
description: Timezone data dtype

Comments:
Going to postpone this. The fix is more complicated than I originally thought.
Removed Panel class from HDF ASVs
State: closed

This is a logical follow up to #25233 which should also help resolve the build failures in #24953

Labels:
name: Deprecate
description: Functionality to remove in pandas
name: Benchmark
description: Performance (ASV) benchmarks

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25281?src=pr&el=h1) Report
> Merging [#25281](https://codecov.io/gh/pandas-dev/pandas/pull/25281?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/4d44a2aff08c3075d9472e361bd7448a0472494e?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #25281   +/-   ##
=======================================
  Coverage   91.72%   91.72%           
=======================================
  Files         173      173           
  Lines       52831    52831           
=======================================
  Hits        48457    48457           
  Misses       4374     4374
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.28% <ø> (ø)` | :arrow_up: |
| #single | `41.72% <ø> (ø)` | :arrow_up: |


------

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

Windows fail looks unrelated.  Re-push?
thanks !
REF: use _constructor and ABCFoo to avoid runtime imports
State: closed

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


Labels:
name: Clean

Comments:
thanks!
A question in general: why do we find run-time imports (within function imports) problematic?

Further concrete note: using `_constructor` has consequences, as this property is explicitly for subclass handling. So using it in eg `pd.to_datetime` means that this function will start returning subclasses if a subclass is passed. And I am not sure we actually want this.
> A question in general: why do we find run-time imports (within function imports) problematic?

A pattern I re-discovered when making a PR to cython a couple weeks ago: runtime imports mean circular dependencies, which make the codebase _much_ harder for newcomers to understand.

it’s not just that I think I saw this on the arrow mailing list recently: 
https://github.com/apache/arrow/pull/3706#issuecomment-465558284

importing an already imported module in python is pretty cheap but apparently is not very cheap in cython
https://github.com/cython/cython/issues/2854
> runtime imports mean circular dependencies, which make the codebase _much_ harder for newcomers to understand.

I would argue for the opposite .. :) Runtime import (eg the Series import in `to_datetime`) is perfectly understandable python code, while the ABCSeries is something very pandas specific that most newcomers will not know.

> importing an already imported module in python is pretty cheap but apparently is not very cheap in cython

OK, that might certainly something to take care of, but here we are speaking about pure python submodules?

---

In any case, I think `to_datetime`/`to_timedelta` change is something we might want to revert (I don't think we want to commit to the behaviour it is preserving a subclass?). The `isna` is a bit less clear (it is used for a method on a Series, so there is also something to say to keep the subclass type)