[BUG] Fix invalid data loading in csvdir bundle#2223
Open
ASzot wants to merge 2 commits intoquantopian:masterfrom
Open
[BUG] Fix invalid data loading in csvdir bundle#2223ASzot wants to merge 2 commits intoquantopian:masterfrom
ASzot wants to merge 2 commits intoquantopian:masterfrom
Conversation
freddiev4
suggested changes
Jul 9, 2018
Contributor
freddiev4
left a comment
There was a problem hiding this comment.
Hey @ASzot thanks for the PR! I have two questions for you below. Also, it looks like tests failed on this run;. You can check if tests pass locally by running:
nosetests tests.data.bundles.test_csvdir:CSVDIRBundleTestCase
zipline/data/bundles/csvdir.py
Outdated
| fname = [fname for fname in files | ||
| if '%s.csv' % symbol in fname][0] | ||
| except IndexError: | ||
| dfr = read_csv(os.path.join(csvdir, fname), |
Contributor
There was a problem hiding this comment.
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.
zipline/data/bundles/csvdir.py
Outdated
| except IndexError: | ||
| dfr = read_csv(os.path.join(csvdir, fname), | ||
| parse_dates=[0], | ||
| infer_datetime_format=False, |
Contributor
There was a problem hiding this comment.
Why wouldn't we want to infer the datetime format?
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Calculating the name of CSV file from the symbol name is not done corretly. The current method would match a filename to a symbol if it ended in the symbol concatenated with
.csv. This means that if there are two stocks Ford (symbol F) and Regions Financial Corporation (symbol RF). Then the calculated filename to load for Ford could be RF.csv which is clearly not the data file for Ford.This is clearly a bug.