Skip to content

Commit

Permalink
Work around tz issue in get_indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Daniels committed Sep 22, 2016
1 parent 5a9b6e2 commit 615a1c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions zipline/data/us_equity_pricing.py
Expand Up @@ -980,10 +980,11 @@ def calc_dividend_ratios(self, dividends):
effective_dates = full(len(amounts), -1, dtype=int64)

calendar = self._calendar
day_locs = calendar.get_indexer(
DatetimeIndex(ex_dates, tz='UTC'),
method='bfill',
)

# Calculate locs against a tz-naive cal, as the ex_dates are tz-
# naive.
tz_naive_calendar = calendar.tz_localize(None)
day_locs = tz_naive_calendar.get_indexer(ex_dates, method='bfill')

for i, amount in enumerate(amounts):
sid = sids[i]
Expand Down

0 comments on commit 615a1c3

Please sign in to comment.