Skip to content

BUG: Some offsets.apply cannot handle tz properly #7465

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

Merged
merged 1 commit into from
Jun 17, 2014

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Jun 14, 2014

There are some offsets which cannot handle input with tz properly

pd.offsets.Day().apply(pd.Timestamp('2010-01-01 9:00', tz='US/Eastern'))
#2010-01-02 09:00:00-05:00 (Expected)

pd.offsets.CustomBusinessDay().apply(pd.Timestamp('2010-01-01 9:00', tz='US/Eastern'))
#2010-01-04 09:00:00 (tzinfo lost)

pd.offsets.CustomBusinessMonthEnd().apply(pd.Timestamp('2010-01-01 9:00', tz='US/Eastern'))
# ValueError: Cannot compare tz-naive and tz-aware timestamps

Affected Offsets

  • pandas.tseries.offsets.CustomBusinessDay'
  • 'pandas.tseries.offsets.CustomBusinessMonthEnd'
  • 'pandas.tseries.offsets.CustomBusinessMonthBegin'
  • 'pandas.tseries.offsets.BusinessMonthBegin'
  • 'pandas.tseries.offsets.YearBegin'
  • 'pandas.tseries.offsets.BYearBegin'
  • 'pandas.tseries.offsets.YearEnd'
  • 'pandas.tseries.offsets.BYearEnd'
  • 'pandas.tseries.offsets.BQuarterBegin'
  • 'pandas.tseries.offsets.LastWeekOfMonth'
  • 'pandas.tseries.offsets.FY5253Quarter'
  • 'pandas.tseries.offsets.FY5253'
  • 'pandas.tseries.offsets.Week'
  • 'pandas.tseries.offsets.WeekOfMonth'
  • 'pandas.tseries.offsets.Easter'

@jreback jreback added this to the 0.14.1 milestone Jun 17, 2014
jreback added a commit that referenced this pull request Jun 17, 2014
BUG: Some offsets.apply cannot handle tz properly
@jreback jreback merged commit ad40979 into pandas-dev:master Jun 17, 2014
@jreback
Copy link
Contributor

jreback commented Jun 17, 2014

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants