Skip to content

Conversation

@jbrockmendel
Copy link
Member

@mroeschke mroeschke added the Deprecate Functionality to remove in pandas label Jan 23, 2023
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.

I guess this is okay (+0) although it makes to_datetime a little less convenient.

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Looks good to me

Reckon the "inverse" should be deprecated as well, i.e. parsing numeric with format as strings, like

In [3]: to_datetime([20200101], format='%Y%m%d') Out[3]: DatetimeIndex(['2020-01-01'], dtype='datetime64[ns]', freq=None) 

?

Comment on lines +1216 to +1218
except OverflowError:
return data, False
except (TypeError, ValueError):
Copy link
Member

@MarcoGorelli MarcoGorelli Jan 24, 2023

Choose a reason for hiding this comment

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

is this just to avoid hitting the warning later in to_datetime(new_data, errors="raise", unit=date_unit), which would be outofbounds anyway?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct

@jbrockmendel
Copy link
Member Author

Reckon the "inverse" should be deprecated as well, i.e. parsing numeric with format as strings, like

That definitely seems like a potential footgun, no idea how common that is in the wild.

@MarcoGorelli MarcoGorelli added the Datetime Datetime data dtype label Jan 26, 2023
@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Jan 26, 2023
@MarcoGorelli MarcoGorelli merged commit 8448d39 into pandas-dev:main Jan 26, 2023
@jbrockmendel jbrockmendel deleted the depr-unit-behavior branch January 26, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Datetime Datetime data dtype Deprecate Functionality to remove in pandas

3 participants