Skip to content

WIP: multi-timezone handling for array_to_datetime #24006

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

Closed
wants to merge 12 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' of https://github.com/pandas-dev/pandas into a2d
  • Loading branch information
jbrockmendel committed Dec 2, 2018
commit 9677010ddf6ed23b4a016a3432e2a9322b5397be
4 changes: 1 addition & 3 deletions pandas/_libs/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ cpdef array_to_datetime(ndarray[object] values, str errors='raise',
bint seen_integer = 0
bint seen_string = 0
bint seen_datetime = 0
bint seen_datetime_offset = 0
bint is_raise = errors=='raise'
bint is_ignore = errors=='ignore'
bint is_coerce = errors=='coerce'
Expand Down Expand Up @@ -634,7 +633,6 @@ cpdef array_to_datetime(ndarray[object] values, str errors='raise',
# to check if all arguments have the same tzinfo
tz = py_dt.utcoffset()
out_tzinfos[get_key(py_dt.tzinfo)] = py_dt.tzinfo

_ts = convert_datetime_to_tsobject(py_dt, None)
iresult[i] = _ts.value
except:
Expand All @@ -648,7 +646,6 @@ cpdef array_to_datetime(ndarray[object] values, str errors='raise',
# where we left off
value = dtstruct_to_dt64(&dts)
if out_local == 1:
seen_datetime_offset = 1
# Store the out_tzoffset in seconds
# since we store the total_seconds of
# dateutil.tz.tzoffset objects
Expand All @@ -659,6 +656,7 @@ cpdef array_to_datetime(ndarray[object] values, str errors='raise',
# Add a marker for naive string, to track if we are
# parsing mixed naive and aware strings
out_tzinfos[None] = None

iresult[i] = value
check_dts_bounds(&dts)

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.