nimi-python icon indicating copy to clipboard operation
nimi-python copied to clipboard

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

Open ni-jfitzger opened this issue 1 year ago • 1 comments

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 avatar Jan 08 '25 22:01 ni-jfitzger

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

ni-jfitzger avatar Jan 08 '25 22:01 ni-jfitzger