-
Notifications
You must be signed in to change notification settings - Fork 120
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
Validation for illegal column names in data
#734
Validation for illegal column names in data
#734
Conversation
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.
LGTM. Only minor comments from my side. Feel free to merge.
@@ -262,12 +262,18 @@ def _intuit_column_groups(df, index, include_index=False): | |||
existing_cols = existing_cols.union(df.columns) | |||
|
|||
# check that there is no column in the timeseries data with reserved names | |||
if None in existing_cols: | |||
raise ValueError("Unnamed column in `data`: None") |
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.
This could also be part of the ILLEGAL_COLS
, i guess, but maybe the message is just clearer this way.
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.
Right, the reason why this is not part ILLEGAL_COLS
is that we have an easy solution for string-column-names, which is part of the error message - but this doesn't work (easily) for None
.
Codecov Report
@@ Coverage Diff @@
## main #734 +/- ##
=====================================
Coverage 95.0% 95.1%
=====================================
Files 59 59
Lines 6020 6044 +24
=====================================
+ Hits 5725 5748 +23
- Misses 295 296 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Please confirm that this PR has done the following:
Documentation AddedName of contributors Added to AUTHORS.rstDescription of PR
During review of #729, I noticed that there may be issues when initializing an IamDataFrame with an unnamed column (None or empty string) - both could give unexpected behavior. This PR adds these two corner cases to the validation routine.