Skip to content

Commit 75e0376

Browse files
gliptakjreback
authored andcommitted
Correct Yahoo period end timestamp calculation (#365)
1 parent a582b2b commit 75e0376

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas_datareader/tests/yahoo/test_yahoo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ def test_get_data_adjust_price(self):
104104
assert 'Adj Close' not in goog_adj.columns
105105
assert (goog['Open'] * goog_adj['Adj_Ratio']).equals(goog_adj['Open'])
106106

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

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

119119
# monthly interval data
120120
pan = web.get_data_yahoo('XOM', '2012-12-31',

pandas_datareader/yahoo/daily.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def yurl(symbol):
9797

9898
def _get_params(self, symbol):
9999
unix_start = int(time.mktime(self.start.timetuple()))
100-
unix_end = int(time.mktime(self.end.timetuple()))
100+
day_end = self.end.replace(hour=23, minute=59, second=59)
101+
unix_end = int(time.mktime(day_end.timetuple()))
101102

102103
params = {
103104
'period1': unix_start,

0 commit comments

Comments
 (0)