Skip to content
Open
Changes from 1 commit
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
9 changes: 6 additions & 3 deletions zipline/data/bundles/csvdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,13 @@ def _pricing_iter(csvdir, symbols, metadata, divs_splits, show_progress):
for sid, symbol in enumerate(it):
logger.debug('%s: sid %s' % (symbol, sid))

fname = symbol + '.csv'
try:
fname = [fname for fname in files
if '%s.csv' % symbol in fname][0]
except IndexError:
dfr = read_csv(os.path.join(csvdir, fname),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the second call to read_csv() below on line 185? We're already calling it here and exiting early if we don't have the file we want.

parse_dates=[0],
infer_datetime_format=False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't we want to infer the datetime format?

index_col=0).sort_index()
except OSError:
raise ValueError("%s.csv file is not in %s" % (symbol, csvdir))

dfr = read_csv(os.path.join(csvdir, fname),
Expand Down