Hi all. Is there any way of applying the `@solid` ...
# announcements
Hi all. Is there any way of applying the
decorator multiple times and having it "just work"? From what I can see it seems like subsequent applications override the first, or something else prevents them from working together. Use-case: we have certain config we want to apply to many solids which is standardised, but a bit verbose to type out every time (e.g. OutputDefinitions). We'd like to wrap it all into our own, standard decorator, which would apply some
config, but then we should also be able to add to that on a solid-by-solid basis when needed with an additional
Hi, I would use a solid factory for this use-case: https://docs.dagster.io/overview/solids-pipelines/solid-factories#main
The generic stuff can be defined inside your solid factory and you can add other parameters as method args, to extend your factory when necessary.
Hi @Ryan - the configured API may be able to supply what you need: https://docs.dagster.io/overview/configuration/configured
Thanks Gregory and Sandy 🙂 I'm not sure if the Configured API would work, as all the examples seem oriented around manipulating the solid's
, i.e. arguments to the underlying compute function. Ended up going with something closer to Gregory's solid factory suggestion 👍🏼 In our case it ended up looking like a thin wrapper decorator around the main
decorator itself, that just adds our standard configs to any arguments it may receive before passing everything through to Dagster to handle as normal.