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

Allowing zero-like values as env variables #391

Closed
bryan-garcia opened this issue Apr 29, 2022 Discussed in #390 · 1 comment · Fixed by #393
Closed

Allowing zero-like values as env variables #391

bryan-garcia opened this issue Apr 29, 2022 Discussed in #390 · 1 comment · Fixed by #393
Assignees
Labels
bug Description of reproducible unexpected behavior. Confirmed Confirmed reproduction of a posted bug.
Milestone

Comments

@bryan-garcia
Copy link

Discussed in #390

Originally posted by bryan-garcia April 29, 2022
Hi Everyone,

There is an issue when providing integer 0 or float 0 in the env.variables block that triggers a ValueError being raised. Specifically it's in yamlspecification.py (method _verify_variables on line 190):

if not value:
    msg = (
        "All variables must have a valid value. Empty strings "
        "are not allowed."
    )
    logger.error(msg)
    raise ValueError(msg)

A value of integer/float 0 in the env.variables block clearly triggers this error.

Sometimes I don't want to use the global.parameter block to define my values, and simply want an env variable. What are some thoughts for allowing this from a design perspective?

@FrankD412
Copy link
Member

Ah that is clearly an oversight -- yeah, the not value is a little too broad and catches the 0. That's a simple fix. For the other bit I'll pick this up in the discussion thread since I'm curious what the use case is.

@FrankD412 FrankD412 self-assigned this Apr 29, 2022
@FrankD412 FrankD412 added bug Description of reproducible unexpected behavior. Confirmed Confirmed reproduction of a posted bug. labels Apr 29, 2022
@FrankD412 FrankD412 added this to the Release 1.1.9 milestone Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Description of reproducible unexpected behavior. Confirmed Confirmed reproduction of a posted bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants