pipeline.objects.variable.PipelineFile( * path: str = None, name: str = None, remote_id: str = None, local_id: str = None, )
PipelineFile class allows for local files to be used passed into a graph via a node in the
Pipeline context manager. It also allows for local files to be wrapped with the graph when sent for remote execution.
When a pipeline graph is serialised for remote execution the local file referenced by the
path variable is serialised and sent as well. When the graph is reformed remotely the
path variable will change to the path on the new system.
str) - the path to the local file.
str, optional) - a separate name associated with the file (not affiliated with it's path).
str, optional) - an ID referring to the remote identifier for the object. Not used locally yet.
str, optional) - an ID used for local referencing of the
Variablein the graph by nodes.
This class function allows for the creation of a
PipelineFile object from a
PipelineVariableGet schema. This is currently not used when running locally but for remote execution.
PipelineFile) - the class method variable.
PipelineVariableGet) - the schema to create the pipeline file from.
from pipeline import Pipeline, PipelineFile @pipeline_function def print_file(file_input: PipelineFile) -> None: with open(file_input.path, "r") as my_file: print(my_file.read()) with Pipeline("test") as builder: ... my_file = PipelineFile(path="some_local_file") print_file(my_file) ...
Updated 20 days ago