Amos
10/07/2024, 1:06 AMAmos
10/07/2024, 7:18 AMParallelizable? Any thoughts on whether it would be better to load data via concurrent tasks in a materializer function or to load via Parallelizable?Stefan Krawczyk
10/07/2024, 7:34 AMParallelizable?
you can annotate functions in parallelizable block with @load_from / @save_to. But you can’t “override/inject” into a parallelizable block (we wouldn’t know which one to overwrite).
> Any thoughts on whether it would be better to load data via concurrent tasks in a materializer function or to load via Parallelizable?
What’s your use case here? Depends. Do you want extra visibility? Or a simpler DAG? or?
Note: Parallelizable doesn’t have an async executor IIRC.Stefan Krawczyk
10/07/2024, 7:40 AMAmos
10/07/2024, 7:59 AMMaterializers is one way, overrides is another, or simple @config.when, or separating out modules — e.g. in fastAPI you have dataloading module + core module, in CLI you only have core module and you pass things in as inputs…Yes of course, maybe modules are neater with a driver factory pattern. I've done something like that before.
you can annotate functions in parallelizable block with @load_from / @save_to. But you can’t “override/inject” into a parallelizable block (we wouldn’t know which one to overwrite).Fair enough. I think I would override/inject downstream of the
Parallelizable loading if I did it that way.
only functions that are async need to be asyncI don't quite follow what …?
What’s your use case here? Depends. Do you want extra visibility? Or a simpler DAG? or?
Note: Parallelizable doesn’t have an async executor IIRCIf no async executor then sounds like putting an existing async paginated loader in an async node is maybe the way to go. Primary use case is packing some fiddly, custom data processing logic behind a FastAPI. I did something similar about six months ago with the async driver and a transformer model and am keen to try and improve on it with the updated version. Visibility is not critical, but since you have your new UI, I would like to try integrating it if circumstances permit. It is important that secondary use cases (CLI/depndency) can be handled from the same codebase, most of which is already async.
Amos
10/07/2024, 8:00 AMStefan Krawczyk
10/07/2024, 2:44 PMI don’t quite follow what …?Yep sorry. Just saying that you don’t need to write all your functions with
async def . Which it sounds like you already know. 🙂