You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In Parallel & Collect blocks, there could be a process boundary. Inputs that are invariant to each chunk of the block need to be serialized and deserialized -- but for things like clients (e.g. openai, db client) those objects aren't serializable and things break.
Describe the solution you'd like
@unserializabledefclient() ->object:
"""Some client, e.g. openai, etc"""return ...
Then Hamilton will know that for each parallel block, we rerun this function, versus trying to run it once and trying to serialize and deserialize it.
Describe alternatives you've considered
You can get around this by making the client() function depend on some part of the parallel block (client(some_dep: object)) thereby forcing it to be run each block.
Additional context
This would be a quality of life improvement.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
In Parallel & Collect blocks, there could be a process boundary. Inputs that are invariant to each chunk of the block need to be serialized and deserialized -- but for things like clients (e.g. openai, db client) those objects aren't serializable and things break.
Describe the solution you'd like
Then Hamilton will know that for each parallel block, we rerun this function, versus trying to run it once and trying to serialize and deserialize it.
Describe alternatives you've considered
You can get around this by making the
client()
function depend on some part of the parallel block (client(some_dep: object)
) thereby forcing it to be run each block.Additional context
This would be a quality of life improvement.
The text was updated successfully, but these errors were encountered: