Skip to content

TYP: maybe_cast_to_datetime #39959

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

Merged
merged 8 commits into from
Feb 24, 2021

Conversation

jbrockmendel
Copy link
Member

Underlying motivation is to make Block._maybe_coerce_values unnecessary, which will improve __init__ perf

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Feb 22, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

question

if is_dt_string:
dta = to_datetime(value, errors="raise").array
if dta.tz is not None:
value = dta.astype(dtype, copy=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

test hits this?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

Copy link
Member Author

Choose a reason for hiding this comment

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

ATM it raises TypeError which we catch and then handle later

@jreback jreback added this to the 1.3 milestone Feb 24, 2021
@jreback jreback merged commit f98e17e into pandas-dev:master Feb 24, 2021
@jreback
Copy link
Contributor

jreback commented Feb 24, 2021

thanks, solid incremental improvement

@jbrockmendel jbrockmendel deleted the typ-maybe_case_to_datetime branch February 24, 2021 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants