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

REF factor out parse_pydatetime from array_to_datetime #49866

Merged

Conversation

MarcoGorelli
Copy link
Member

  • 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.

Precursor to #49298 , for which this function will be used in strptime.pyx too

@MarcoGorelli MarcoGorelli force-pushed the factor-out-handle-pydatetime branch from 56afb9b to 89eec4a Compare November 23, 2022 15:56
@MarcoGorelli MarcoGorelli added the Datetime Datetime data dtype label Nov 23, 2022
@MarcoGorelli MarcoGorelli changed the title REF factor out parse_pydatetime REF factor out parse_pydatetime from array_to_datetime Nov 23, 2022
@MarcoGorelli MarcoGorelli force-pushed the factor-out-handle-pydatetime branch from 135d31a to 657699e Compare November 23, 2022 18:30
raise ValueError('Cannot mix tz-aware with '
'tz-naive values')
return tz_out

Copy link
Member

Choose a reason for hiding this comment

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

one more newline

Copy link
Member Author

@MarcoGorelli MarcoGorelli Nov 23, 2022

Choose a reason for hiding this comment

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

you're right (and that's another one for cython-lint!)

done

Copy link
Member Author

@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.

Thanks Will and Brock for your reviews!

raise ValueError('Cannot mix tz-aware with '
'tz-naive values')
return tz_out

Copy link
Member Author

@MarcoGorelli MarcoGorelli Nov 23, 2022

Choose a reason for hiding this comment

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

you're right (and that's another one for cython-lint!)

done

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm

@mroeschke mroeschke added this to the 2.0 milestone Nov 24, 2022
@MarcoGorelli
Copy link
Member Author

thanks for your reviews and explanations!

merging then to take the next step towards #49298

@MarcoGorelli MarcoGorelli merged commit c6bbda5 into pandas-dev:main Nov 24, 2022
mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
)

* factor out parse_pydatetime

* fix segfault

* 🚚 rename validate_tzout to convert_timezone

* change ensure_reso return value

* add except? -1 to ensure_reso

Co-authored-by: MarcoGorelli <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants