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

metadata_add_all._add_enum_value_python_name() removes common prefixes, suffixes from a user-set 'python_name'. #2066

Open
ni-jfitzger opened this issue Jan 8, 2025 · 1 comment

Comments

@ni-jfitzger
Copy link
Collaborator

Description of issue

The 'python_name' key for enum values pulls double duty in metadata_add_all._add_enum_value_python_name(). It's intended that a user can set it to override the expanded name with the name that they want to be used in the API. In such a case, the user-set value should not be modified. But the helper method also uses the same key for the expansion process when it's not set by the user and does not track whether the user set it. As a result, common prefixes or suffixes may get removed from the user-set 'python_name', instead of using it, as is, to override the expanded name.

@ni-jfitzger ni-jfitzger changed the title metadata_add_all._add_enum_value_python_name() removes common suffixes from a user-set 'python_name'. metadata_add_all._add_enum_value_python_name() removes common prefixes, suffixes from a user-set 'python_name'. Jan 8, 2025
@ni-jfitzger
Copy link
Collaborator Author

Fixing this may require updating some metadata that incorrectly relies on the behavior.

@ni-jfitzger ni-jfitzger added this to the nimi-python 1.4.9 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant