Skip to content

array_to_datetime set seen_datetime consistently #18554

Closed
@jbrockmendel

Description

@jbrockmendel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions