That’s what I also thought, but the configured obj...
# announcements
a
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
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
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
the acceptable name format is different from the acceptable alias format
uh oh
a
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
ya i believe aliases should enforce the same rules and it was an oversight on our part that they dont
a
Ok, I’ll write that up too.
a
thanks!