Skip to content

Commit

Permalink
Correct Yahoo period end timestamp calculation (pydata#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
gliptak authored and jreback committed Jul 10, 2017
1 parent a582b2b commit 75e0376
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pandas_datareader/tests/yahoo/test_yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ def test_get_data_adjust_price(self):
assert 'Adj Close' not in goog_adj.columns
assert (goog['Open'] * goog_adj['Adj_Ratio']).equals(goog_adj['Open'])

@pytest.mark.xfail(reason="failing after #355")
@skip_on_exception(RemoteDataError)
def test_get_data_interval(self):
# daily interval data
pan = web.get_data_yahoo('XOM', '2013-01-01',
'2013-12-31', interval='d')
assert len(pan) == 251
assert len(pan) == 252

# weekly interval data
pan = web.get_data_yahoo('XOM', '2013-01-01',
'2013-12-31', interval='w')
assert len(pan) == 52
assert len(pan) == 53

# monthly interval data
pan = web.get_data_yahoo('XOM', '2012-12-31',
Expand Down
3 changes: 2 additions & 1 deletion pandas_datareader/yahoo/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def yurl(symbol):

def _get_params(self, symbol):
unix_start = int(time.mktime(self.start.timetuple()))
unix_end = int(time.mktime(self.end.timetuple()))
day_end = self.end.replace(hour=23, minute=59, second=59)
unix_end = int(time.mktime(day_end.timetuple()))

params = {
'period1': unix_start,
Expand Down

0 comments on commit 75e0376

Please sign in to comment.