Stephen Bailey
06/07/2022, 1:04 PM@op(config_schema={"message": str})
def print_something(context):
print(context.op_config["message"]
default_config = {
"ops": {
"print_message": {
"config": {
"message": "foo"
}
}
}
}
@job(config=default_config)
def print_message_job():
print_message()
what i was expecting when i first started was something where op config was a sort of "primary" config, and everything else was secondary, something like:
@op(config_schema={"message": str})
def print_something(context):
print(context.op_config["message"]
default_config = {
"print_something.query": "select 1"
}
@job(op_config=default_config):
def print_message_job():
print_message()
Stephen Bailey
06/07/2022, 1:12 PMZach
06/07/2022, 4:11 PMStephen Bailey
06/07/2022, 4:16 PMZach
06/07/2022, 4:16 PMsandy
06/07/2022, 8:50 PMconfigured
might be useful here:
@op(config_schema={"message": str})
def print_something(context):
print(context.op_config["message"]
default_config = {
"message": "hello"
}
@job
def print_message_job():
print_message.configured(default_config)()
Stephen Bailey
06/08/2022, 1:20 PMconfigured
for ops yet, only for resources.
i was able to get an _almost_ MVP of what I was thinking put together using a config_mapping generator. there's an issue with mapping the input to config, just don't have the time to fix it. 🤷