Skip to content

Correct Yahoo period end timestamp calculation #365

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
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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