Hi all! Is there a way to hook into the dagster co...
# announcements
Hi all! Is there a way to hook into the dagster config type validation mechanism? I’ve been using pydantic for validating types, and that works when combining dagster type loaders + the config “inputs” section. However validation errors are discovered only at runtime. Is there a way to define custom field validators through eg a function? Alternatively, to define custom dagster config types?
You could write tests 🙂
Do you have an example for context? We don’t really allow user code to run at config validation time so it can happen in the “host” process which doesn’t have guaranteed access to user code
That makes sense. An example is a configuration input that has additional dependency structure. For example, when you want to rename categories, in a dataframe, you want to pass a dict representing the rename map. It has additional structure that the map is 1-1; otherwise you’re doing a binning operation on the categories. If possible, I’d like to add a function that ensures this 1-1 constraint is satisfied. That said, it’s not really a significant pain point, and also I could see how such a feature could add complexity.
@Noah K it’s true I should write tests, but this question is more about the config validation step (ie the
), not at the body of the solid.