https://dagster.io/ logo
#ask-community
Title
# ask-community
t

Tom Reilly

02/08/2023, 5:25 PM
I have a resource defined via
make_values_resource
which holds some values shared among multiple assets in a job. Is there a way to run validation on these values (beyond just type checking) when a job is initiated so that the job will not start executing unless validations pass? For example,
Copy code
"some_resource": make_values_resource(
    some_value=int,
)
could I setup a validation that asserts
some_value
is an odd number?
🤖 1
s

sean

02/08/2023, 6:15 PM
Hi Tom, there is no hook in
make_values_resource
for arbitrary validation logic. If you want to do that, you could define a custom resource that is similar to `make_values_resource`:
Copy code
@resource(config_schema=<config_schema>)
def my_values_resource(context):
    value = context.resource_config
    # … arbitrary validation on `value`
    return value
thank you box 1
2 Views