-
Notifications
You must be signed in to change notification settings - Fork 0
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
transform-field-names
: Skip field if old_field_name
== new_field_name
#38
Conversation
WARNING: skipping rename of isolate because record already has a field named strain. | ||
{"strain":"A","isolate":"B"} | ||
|
||
If the `--field-map` overwrites an existing field if using `--force` flag. |
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.
minor non-blocking nit-pick: "The --field-map
may overwrite an existing field ..."
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.
Updated in force-push
@@ -27,6 +28,10 @@ if __name__ == '__main__': | |||
field_map = {} | |||
for field in args.field_map: | |||
old_name, new_name = field.split('=') | |||
|
|||
if old_name == new_name: | |||
continue |
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.
Looks good to me!
Show the current behavior of `transform-field-names` in preparation for updating the behavior in following commit.
0f00c52
to
1f9a382
Compare
Description of proposed changes
If the old field name is the same as the new field name (case sensitive), then skip renaming.
Resolves #37
Checklist
If adding a script, add an entry for it in the README.