What is the issue?
Reported by Mike, in Discord.
When calling a Dagger Function with an enum as a parameter's default value, omitting its flag returns an error.
Using --debug I can confirm that the CLI is sending an empty string to the API:
# dagger call test-func
{
enumDefault {
testFunc(env: "")
}
}
Dagger version
dagger v0.12.1 (registry.dagger.io/engine) darwin/arm64
Steps to reproduce
Create a simple module:
❯ dagger init --sdk=python enum-default
With the following test example:
import dagger
@dagger.enum_type
class Env(dagger.Enum):
"""Environment the project will be run in"""
DEV = "DEV"
INT = "INT"
TEST = "TEST"
@dagger.object_type
class EnumDefault:
@dagger.function
async def test_func(self, env: Env = Env.DEV) -> Env:
return env
Call with:
Log output
Error: response from query: input: enumDefault.testFunc resolve: failed to convert arg "env": invalid enum value ""
Expected
What is the issue?
Reported by Mike, in Discord.
When calling a Dagger Function with an enum as a parameter's default value, omitting its flag returns an error.
Using
--debugI can confirm that the CLI is sending an empty string to the API:Dagger version
dagger v0.12.1 (registry.dagger.io/engine) darwin/arm64
Steps to reproduce
Create a simple module:
❯ dagger init --sdk=python enum-defaultWith the following test example:
Call with:
❯ dagger call test-funcLog output
Expected