-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[FIX] Table names set by readers #1481
Conversation
(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). |
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
|
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 :) |
It's not uncommon for file-like objects to be supported in place of filename paths. |
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.