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

array_to_datetime set seen_datetime consistently #18554

Closed
jbrockmendel opened this issue Nov 28, 2017 · 3 comments
Closed

array_to_datetime set seen_datetime consistently #18554

jbrockmendel opened this issue Nov 28, 2017 · 3 comments

Comments

@jbrockmendel
Copy link
Member

From tslib.array_to_datetime

                try:
                    check_dts_bounds(&dts)
                    seen_datetime = 1
                except ValueError:
                    if is_coerce:
                        iresult[i] = NPY_NAT
                        continue
                    raise

If this raises, it gets caught and tries a different strategy, that strategy depending on seen_datetime. This pattern shows up twice, and in each case, a date/datetime has been seen regardless of whether check_dts_bounds raises.

Is there a reason why we're not setting seen_datetime=1 unconditionally before the bounds check?

@jreback
Copy link
Contributor

jreback commented Nov 28, 2017

you would have to show an example. seen_datetime is only set if the bounds check doesn't raise

@jreback
Copy link
Contributor

jreback commented Nov 29, 2017

@jbrockmendel example?

@jbrockmendel
Copy link
Member Author

I don't have one off the top, feel free to close. I'll put this on a low rung of the todo list.

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

No branches or pull requests

2 participants