https://dagster.io/ logo
a

antonl

02/09/2021, 8:08 PM
That’s what I also thought, but the configured object doesn’t really behave like a solid afterward. I posted a bug report, but then I started to wonder if my mental model is wrong. Eg https://github.com/dagster-io/dagster/issues/3662
a

alex

02/09/2021, 8:13 PM
ya i think this is legit bug with
execute_solid
and
.alias()
I think this might work :
Copy code
from dagster import configured, solid, execute_solid

_MESSAGE_ALIAS_KEY = "say[{message}]"


@solid(
    config_schema={
        "message": str
    }
)
def say(context, name: str) -> str:
    message = context.solid_config.get("message")
    return f"{message} {name}!"


def message_factory(message):
    return say.configured(
        {"message": message},
        name=_MESSAGE_ALIAS_KEY.format(message=message)
    )

say_hello = message_factory("hello")

result = execute_solid(say_hello, input_values={
    "name": "Dagster"
})
a

antonl

02/09/2021, 8:16 PM
Oh yeah. But this hits another bug I forgot to report: the acceptable name format is different from the acceptable alias format 🙂
Anyway, thanks for the help! I’ll use this. It’s way easier than writing a composite solid for this.
a

alex

02/09/2021, 8:22 PM
the acceptable name format is different from the acceptable alias format
uh oh
a

antonl

02/09/2021, 8:25 PM
I think you use this for the dynamic output actually. You generate names like
solid_name[$key]
, but the regex for solid names only allows
^[A-Za-z0-9_]+
.
a

alex

02/09/2021, 8:26 PM
ya i believe aliases should enforce the same rules and it was an oversight on our part that they dont
a

antonl

02/09/2021, 8:27 PM
Ok, I’ll write that up too.
a

alex

02/09/2021, 9:00 PM
thanks!