BUG: Fix to_datetime(errors='coerce') not swallowing all parser exceptions...
State: closed

… (#28299)

- [x] closes #28299
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: Datetime
description: Datetime data dtype
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
this *might* solve https://github.com/pandas-dev/pandas/issues/25143, https://github.com/pandas-dev/pandas/issues/23447, https://github.com/pandas-dev/pandas/issues/9107

if you'd have a look (if so pls add a test for whatever this solves)
> this _might_ solve #25143, #23447, #9107
> 
> if you'd have a look (if so pls add a test for whatever this solves)

Looks like none of these is affected. At least one seems to be handled by a different change
@squigmig 

> Looks like none of these is affected. At least one seems to be handled by a different change

care to do a PR with a test for (which?) one
> > Looks like none of these is affected. At least one seems to be handled by a different change
> 
> care to do a PR with a test for (which?) one

sure, have raised #28386

...

Failing checks on this PR seem to be intermittent. What is the preferred way to resolve or force a re-run?

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=17284
Checks: Setup environment and build pandas is probably the originator of the rest of the failures
```conda env create -q --file=environment.yml
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

CondaHTTPError: HTTP 404 NOT FOUND for url <https://repo.anaconda.com/pkgs/main/linux-64/widgetsnbextension-3.5.1-py37_0.conda>
Elapsed: 00:00.006773
CF-RAY: 5148a6736939e0b2-IAD

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

##[error]Bash exited with code '1'.
##[section]Finishing: Setup environment and build pandas```
Pushing an empty commit, or asking a maintainer. I've restarted the build.

On Wed, Sep 11, 2019 at 8:53 AM Miguel <notifications@github.com> wrote:

> Looks like none of these is affected. At least one seems to be handled by
> a different change
>
> care to do a PR with a test for (which?) one
>
> sure, have raised #28386 <https://github.com/pandas-dev/pandas/pull/28386>
>
> ...
>
> Failing checks on this PR seem to be intermittent. What is the preferred
> way to resolve or force a re-run?
>
> https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=17284
> Checks: Setup environment and build pandas is probably the originator of
> the rest of the failures
>
> Collecting package metadata (repodata.json): ...working... done
> Solving environment: ...working... done
>
> CondaHTTPError: HTTP 404 NOT FOUND for url <https://repo.anaconda.com/pkgs/main/linux-64/widgetsnbextension-3.5.1-py37_0.conda>
> Elapsed: 00:00.006773
> CF-RAY: 5148a6736939e0b2-IAD
>
> An HTTP error occurred when trying to retrieve this URL.
> HTTP errors are often intermittent, and a simple retry will get you on your way.
>
> ##[error]Bash exited with code '1'.
> ##[section]Finishing: Setup environment and build pandas```
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/28367?email_source=notifications&email_token=AAKAOITUQ4YG3KAJNDXA5G3QJDZ7LA5CNFSM4IVFMYV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OSAPY#issuecomment-530391103>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAKAOIWV4WARTKQ7VVWZE3DQJDZ7LANCNFSM4IVFMYVQ>
> .
>

thanks @squigmig 
The test this introduced is failing for me locally.  Anyone else?
rebuild your C extensions?

On Thu, Sep 12, 2019 at 11:13 AM jbrockmendel <notifications@github.com>
wrote:

> The test this introduced is failing for me locally. Anyone else?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/28367?email_source=notifications&email_token=AAKAOIWC5FWLNP44TWXIK4LQJJTBNA5CNFSM4IVFMYV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6SNWCA#issuecomment-530897672>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAKAOIVW6V7IKRW67N3YJXLQJJTBNANCNFSM4IVFMYVQ>
> .
>

> rebuild your C extensions?

Running `python3 setup.py build_ext --inplace` everything looked up-to-date.  Doing the same after `python3 setup.py clean` I'm now getting `Exception: Cython-generated file 'pandas/_libs/algos.c' not found`.  Did the pyproject thing or something affect the workflow?
yes i've got the same. on Windows. total rebuild, clean and conda env. but currently have two failures. one is the allowed failure #28125. still investigating but the failing test in pandas/tests/indexes/datetimes/test_tools.py now passes.
upgrading cython from 0.29.10 seems to fix the build (tentatively).  i might make a PR to give a better error message for that case