Separate out _convert_datetime_to_tsobject by jbrockmendel · Pull Request #17715 · pandas-dev/pandas (original) (raw)

A bunch of calls to convert_to_tsobject are made in cases where we already know that the input is a datetime object. This PR separates out the datetime case into a new function _convert_datetime_to_tsobject.

Second, to make the dependency between _TSObject and Timestamp one-way, this removes the three references to Timestamp that are made in convert_str_to_tsobject. Verifying the last of these changes may be non-trivial.

This is a prelude to separating _TSobject logic out into tslibs.conversion.