Ivan Tsarev
05/26/2023, 5:40 AMConfigured
API does not deal with resources unfortunately.owen
05/26/2023, 5:29 PMdef get_graph(resource_key: str):
@op(
name=f"op_for_{resource_key}",
required_resource_keys={resource_key}
)
def some_op():
...
@graph(name=f"graph_for_{resource_key}")
def some_graph():
return some_op()
return some_graph
Ivan Tsarev
05/26/2023, 5:44 PMTransformer
classes and simple TransformResource
wrapper around them which can be configurable for every job.
But I didn't manage to make resource config param to be a arbitrary python class. I suppose there are strict restrictions in legacy system which mostly preserved in new pydantic-based configs as well (However I did not completely give up on making such "architecture" works inside pydantic config but no luck yet).
I understand that its possible to make less elegant solution with choosing transform logic inside resource based on string config but tbh it does not feel that good 🙂
And graph factory is a completely new approach for me, maybe I should give it a try as well, thank you!