Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: to_datetime with mixed-string-and-numeric #55780

Merged
merged 3 commits into from
Nov 2, 2023

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Oct 31, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Surfaced while implementing #55564

@jbrockmendel jbrockmendel requested a review from WillAyd as a code owner October 31, 2023 21:32
# do 2-step
ts = Timestamp(item).tz_convert(tz)
else:
ts = Timestamp(item, tz=tz)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Should we use tz_localize here to be more explicit?

Copy link
Member Author

Choose a reason for hiding this comment

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

the point is to match the behavior of calling the constructor this way, so i prefer this.

But now that #55712 is merged we can replace all of this with convert_to_tsobject which will move the ball down the field on a bunch of fronts. will update

Copy link
Member Author

Choose a reason for hiding this comment

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

looks like moving to convert_to_tsobject introduces its own set of issues, so ill do that in a separate PR

@mroeschke mroeschke added the Datetime Datetime data dtype label Nov 1, 2023
@mroeschke mroeschke added this to the 2.2 milestone Nov 2, 2023
@mroeschke mroeschke merged commit ba43224 into pandas-dev:main Nov 2, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the bug-dti-mixed-str branch November 2, 2023 16:01
@mroeschke
Copy link
Member

@jbrockmendel mind taking a look at this test failure on main? This PR might have been responsible https://github.com/pandas-dev/pandas/actions/runs/6728530133/job/18288031590

@jbrockmendel
Copy link
Member Author

will do

@jbrockmendel
Copy link
Member Author

Reverting this doesn't seem to fix the problem, but it definitely seems connected to what ive been doing the last few days. i'll keep trying to track this down

@mroeschke
Copy link
Member

Thanks!

@jbrockmendel
Copy link
Member Author

i dont think a measured-in-minutes fix is forthcoming. might need to xfail or comment-out that offending line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants