Skip to content

BUG: Concat with tz-aware and timedelta raises AttributeError #12635

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 1 commit into from

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Mar 15, 2016

@jreback 's comment on #12620:

should be handled at a slightly higher level.

I added number of dtype check logic in tseries/common/_concat_compat. But it should work on base/common/_concat_compat. Lmk which is preferable.

@sinhrks sinhrks added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timedelta Timedelta data type Timezones Timezone data dtype labels Mar 15, 2016
@sinhrks sinhrks added this to the 0.18.1 milestone Mar 15, 2016
new_values = np.concatenate([x.view(np.int64) for x in to_concat],
axis=axis)
return new_values.view(_NS_DTYPE)

elif not len(typs - set(['timedelta'])):
elif 'timedelta' in typs:
new_values = np.concatenate([x.view(np.int64) for x in to_concat],
axis=axis)
return new_values.view(_TD_DTYPE)

# need to coerce to object
to_concat = [convert_to_pydatetime(x, axis) for x in to_concat]
Copy link
Contributor

Choose a reason for hiding this comment

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

looking at this now, I suspect this is a bug here, which I believe you have in another issue. Eg. a timedelta and a datetime (with or w/o tz) may be conveted to object, BUT they go thru the convert_to_datetime which is incorrect for timedelta.

Copy link
Member Author

Choose a reason for hiding this comment

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

convert_to_pydatetime is defined in directly above, and it has a logic for timedelta. Doesn't current test case test_concat_tz_series_with_datetimelike cover your case?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this hits here: #12620

@codecov-io
Copy link

Powered by Codecov. Updated on successful CI builds.

@jreback jreback closed this in eeb81f6 Mar 17, 2016
@jreback
Copy link
Contributor

jreback commented Mar 17, 2016

thanks @sinhrks

@sinhrks sinhrks deleted the tz_concat_object branch March 19, 2016 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Timedelta Timedelta data type Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Concat with tz-aware and timedelta raises AttributeError
3 participants