[FIX] Table names set by readers#1481
Merged
astaric merged 4 commits intobiolab:masterfrom Aug 3, 2016
Merged
Conversation
Member
|
(Some) readers can work with data which is passed as a StreamIO (instead of the filename), which is used in tests to avoid writing unnecessary temp files. For those cases, name should still default to untitled (instead of crashing). |
Member
|
And some tests would be nice :) |
Check that filename is actually a string with the file name and not a StringIO object as used in some tests.
Current coverage is 88.20% (diff: 100%)@@ master #1481 diff @@
==========================================
Files 77 77
Lines 7617 7624 +7
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 6718 6725 +7
Misses 899 899
Partials 0 0
|
Contributor
Author
|
Yuck! And then one subclass (without a comment) abuses the filename parameter for StringIO objects and we hack open to not open in some cases. And we want to maintain this although it is never used anywhere in the code apart from tests...? But that should be handled in another PR / refactoring if we want this PR closed before winter :) |
Contributor
|
It's not uncommon for file-like objects to be supported in place of filename paths. |
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.
Although Tables should ideally be constructed using Table methods (e.g. from_file), sometimes readers are used directly (as in owfile.py). Currently names are not set properly in that case, leading to 'untitled' datasets.
This changes readers (csv,tab,excel) to return more complete data Tables with names set.