Skip to content
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

Merged
merged 2 commits into from
May 28, 2024

Conversation

joverlee521
Copy link
Contributor

@joverlee521 joverlee521 commented May 28, 2024

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

  • Checks pass
  • If adding a script, add an entry for it in the README.

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.
Copy link
Contributor

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 ..."

Copy link
Contributor Author

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
Copy link
Contributor

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.
@joverlee521 joverlee521 force-pushed the update-transform-field-names branch from 0f00c52 to 1f9a382 Compare May 28, 2024 21:54
@joverlee521 joverlee521 merged commit 0f55d15 into main May 28, 2024
2 checks passed
@joverlee521 joverlee521 deleted the update-transform-field-names branch May 28, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

transform-field-names: Skip field if old_field_name == new_field_name
3 participants