Skip to content

Commit

Permalink
Merge pull request #475 from bashtage/morningstar-bug-column-order
Browse files Browse the repository at this point in the history
BUG: Fix order of columns in morningstar
  • Loading branch information
bashtage committed Jan 23, 2018
2 parents 9e9d63c + b657e30 commit 39b5b16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pandas_datareader/mstar/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,8 @@ def _restruct_json(self, symbol, jsondata):
bar = pricedata[p]
d = next(date_)
bardict = {
"Symbol": symbol, "Date": d, "Open": bar[0], "High": bar[1],
"Low": bar[2],
"Close": bar[3]
"Symbol": symbol, "Date": d, "Close": bar[0], "High": bar[1],
"Low": bar[2], "Open": bar[3]
}
if len(divdata) == 0:
pass
Expand Down
4 changes: 2 additions & 2 deletions pandas_datareader/tests/mstar/test_daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_mstar(self):
start = datetime(2014, 3, 5)
end = datetime(2018, 1, 18)
df = web.DataReader('MSFT', 'morningstar', start=start, end=end)
assert (df['Close'][-1] == 89.8)
assert (df['Open'][-1] == 89.8)

@skip_on_exception(RemoteDataError)
def test_get_data_single_symbol(self):
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_mstar_reader_class(self):
dr = MorningstarDailyReader(symbols="GOOG", interval="d")
df = dr.read()

assert df.Volume[('GOOG', '2017-12-13')] == 1279659
assert df.Close[('GOOG', '2017-12-13')] == 1040.61

session = requests.Session()

Expand Down

0 comments on commit 39b5b16

Please sign in to comment.