Skip to content

Conversation

@MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Dec 17, 2022

#50319 will happen to close #2586

This PR will make sure that bugs like #2586 don't appear again

Closes #2586

@MarcoGorelli MarcoGorelli added Bug Datetime Datetime data dtype labels Dec 17, 2022
@MarcoGorelli MarcoGorelli marked this pull request as draft December 17, 2022 19:31
@MarcoGorelli MarcoGorelli marked this pull request as ready for review December 17, 2022 22:06
@MarcoGorelli MarcoGorelli marked this pull request as draft December 17, 2022 22:06
MarcoGorelli added 2 commits December 22, 2022 21:17
@MarcoGorelli MarcoGorelli marked this pull request as ready for review December 22, 2022 21:22
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay. Needs a whatsnew note?

@MarcoGorelli
Copy link
Member Author

I don't think so, I don't have any example of where this makes a difference to users

Basically, PDEP4 was supposed to fix #2586, but didn't because of an exception which was being swallowed by this try-except block
The raising of that exception was fixed in #50319
and now this except block doesn't make a difference (all tests pass without it).

Given that PDEP4 hasn't had an effect on users yet, I'd consider this just be part of that change and not have a separate whatsnew

@mroeschke mroeschke added this to the 2.0 milestone Dec 27, 2022
@mroeschke mroeschke merged commit 3bc2203 into pandas-dev:main Dec 27, 2022
@mroeschke
Copy link
Member

Thanks @MarcoGorelli

@jorisvandenbossche
Copy link
Member

With the removal of the dateutil code path, the docstring of date_parser is outdated?

date_parser : function, optional Function to use for converting a sequence of string columns to an array of datetime instances. The default uses ``dateutil.parser.parser`` to do the conversion. Pandas will try to call `date_parser` in three different ways, advancing to the next if an exception occurs: 1) Pass one or more arrays (as defined by `parse_dates`) as arguments; 2) concatenate (row-wise) the string values from the columns defined by `parse_dates` into a single array and pass that; and 3) call `date_parser` once for each row using one or more strings (corresponding to the columns defined by `parse_dates`) as arguments. 

Although I suppose it was already outdated, because dateutil.parser was already a fallback after to_datetime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Datetime Datetime data dtype

4 participants