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
Handle non-string column names #255
Conversation
Removing WIP. Note that the main check
is one of many ways we might want to check for strings in both Python 2 and 3. @rwedge has suggested that we have used
elsewhere in Featuretools to ensure that we're consistently encoding things. This solution used fewer lines of code than a try/except block, but I don't have a strong preference for the way we should be doing this. |
4d69008
to
cc846de
Compare
featuretools/entityset/entityset.py
Outdated
@@ -1211,6 +1211,9 @@ def _import_from_dataframe(self, | |||
r.child_entity.id == entity_id] | |||
|
|||
for c in dataframe.columns: | |||
if not is_string(c): | |||
raise ValueError("All column names must be strings. (Column has name {})".format(c)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change language to "All column names must be strings (Column {} is not a string)"
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
==========================================
+ Coverage 94.15% 94.15% +<.01%
==========================================
Files 71 71
Lines 7644 7652 +8
==========================================
+ Hits 7197 7205 +8
Misses 447 447
Continue to review full report at Codecov.
|
Looks good. Merging |
close #254
This is an implementation of option 2 from #254 where we raise an error whenever we see a non
str
column name. There is also unit test with an integer column name to see that the error is raised.Since this is one of a few possible solutions, it's marked as WIP until we determine which path we want to follow.