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

bugs in load_parameter_file #960

Open
huweiATgithub opened this issue Jan 12, 2025 · 0 comments
Open

bugs in load_parameter_file #960

huweiATgithub opened this issue Jan 12, 2025 · 0 comments

Comments

@huweiATgithub
Copy link

Bug report

Required Info:

  • Version or commit hash:
    def get_parameter_value(*, string_value):
    """Guess the desired type of the parameter based on the string value."""
    value = ParameterValue()
    try:
    yaml_value = yaml.safe_load(string_value)
    except yaml.parser.ParserError:
    yaml_value = string_value

Steps to reproduce issue

The current implementation has an extra yaml.safe_load for parameter value which has been loaded once already.
This will result in wrong results, e.g.,

key: ''

is once being loaded to {"key": ""}. Another load for the empty string "" will convert it into None.

Implementation considerations

Consider removing the extra yaml load.

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

No branches or pull requests

1 participant