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

localize_tso unnecessary calls? #17944

Closed
jbrockmendel opened this issue Oct 22, 2017 · 3 comments · Fixed by #18086
Closed

localize_tso unnecessary calls? #17944

jbrockmendel opened this issue Oct 22, 2017 · 3 comments · Fixed by #18086
Labels
Milestone

Comments

@jbrockmendel
Copy link
Member

Related: #17876, #17734

In tslib._localize_tso there are 4 of blocks of the form:

        if obj.value != NPY_NAT:
            pandas_datetime_to_datetimestruct(obj.value + delta,
                                              PANDAS_FR_ns, &obj.dts)
        else:
            pandas_datetime_to_datetimestruct(obj.value,
                                              PANDAS_FR_ns, &obj.dts)

But in the case where obj.value == NPY_NAT, can't we skip the call to pandas_datetime_to_datetimestruct because we're going to end up with NaT anyway?

@sinhrks sinhrks added the Clean label Oct 23, 2017
@gfyoung
Copy link
Member

gfyoung commented Oct 23, 2017

@jbrockmendel : There's one way to find out: remove the calls and run the tests 😄

@jbrockmendel
Copy link
Member Author

Doesn't cause any test failures; kind of hoping for outside confirmation though.

@jbrockmendel jbrockmendel mentioned this issue Oct 27, 2017
59 tasks
@jbrockmendel
Copy link
Member Author

This can be fixed in a follow-up after #17875 is closed

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

Successfully merging a pull request may close this issue.

4 participants