Open daw3rd opened 4 months ago
I am not convinced that this is the right thing to do. It will only work if all transforms in the sequence have comparable dependencies, which is not a save assumption. It might easily lead to library conflicts, which are hard to debug. We intentionally are running different transforms in different Python processes to avoid this issue
Start of formal design discussion, given recent interest in this requirement. The basic requirement is as follows then:
The base AbstractBinaryTransform (and AbstractTableTRansform) already work on in-memory objects, so I believe we can use these frameworks to implement a transform that calls a list of transforms, passing outputs to inputs as in-memory objects. This same transform could then also be run as any other transform in any of our run-times to operate on on-disc data to create new output files.
Some complications/considerations
c2p = Code2ParquetTransform({ "domain" : "foo"})
noop = NoopTransform({"sleep": 1 })
p = Pipeline([c2p, noop])
However, to support CLI configuration for the run-times, a dictionary should be supported.
Maybe a nested/structured JSON/AST needs to be used to specify the configuration of the transforms.
{
"code2parquet" : { "domain": "foo" },
"noop" : { "sleep": 1 }
}
Then the pipeline cli would be --pipeline_transforms "{ "code2parquet": ...}". How would we map from transform string references (i.e. "code2parquet) to a python class. For example, in the above, using "code2parquet" would require a registry of mappings of strings to transform classes. Are there alternatives? Maybe the full python class name?
I would rather continue with the launcher, etc.
There are certain limitations on the pipelining. From the point of view of the runtime, the pipeline has to be seen as a single binary transform to ensure that all of the transform's invocations are happening on the same thread
Search before asking
Component
Library/core
Feature
It would be useful to be able define a sequence of transforms that are run one after the other, within a python process. This should be implemented as an AbstractBinaryTransform, probably that takes a list of transform instances. The configuration for this class could either be a single dictionary or a list of dictionaries corresponding 1:1 with the list of transforms. This "pipeline transform" should also be runnable in a runtime like any other transform. This latter may mean a single config dict is used to initialize the "pipeline transform".
Are you willing to submit a PR?