-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add a validation check to rename()
#202
Merged
gidden
merged 7 commits into
IAMconsortium:master
from
danielhuppmann:rename_wich_check
Feb 27, 2019
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a6a9243
add first try for `rename(check_duplicates=True)`
danielhuppmann 1e9d7cf
add test for `rename(check_duplicates=True)`
danielhuppmann cf82db4
extend error message to show conflict rows
danielhuppmann 86bd474
appease stickler
danielhuppmann cf89887
add to release notes
danielhuppmann 80bb251
only make interim copy if `check_duplicates is True`, add inline comment
danielhuppmann 57115e7
pep8
danielhuppmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
why do we need to make a copy here?
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.
In case
check_duplicates=True
and aValueError
is raised, we don't want any changes to theIamDataFrame
to persist.But I guess
_data = ret.data.copy() if check_duplicates else ret.data
would be slightly more efficient, right?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.
Agreed. Can you add a warning in the docstring stating that this makes a copy as well? Also, are you sure we want that to be
True
by default? What are the pro/cons?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.
Added the more elaborate only-make-interim-copy-if-
check_duplicates
and an inline comment to explain that the interim copy is kept until after the validation check.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.
I think that the more careful behaviour (
check_duplicates == True
) should be the default. Users should explicitly have to override the sanity check when (as in the unit test) renaming timeseriestest_1
totest_3
and aggregating with existing timeseries data oftest_3
.