DataPath Class
Represents a path to data in a datastore.
The path represented by DataPath object can point to a directory or a data artifact (blob, file). DataPath is used in combination with the DataPathComputeBinding class, which defines how the data is consumed during pipeline step execution. A DataPath can be modified at during pipeline submission with the PipelineParameter.
Initialize DataPath.
- Inheritance
-
builtins.objectDataPath
Constructor
DataPath(datastore=None, path_on_datastore=None, name=None)
Parameters
Name | Description |
---|---|
datastore
|
[Required] The Datastore to reference. Default value: None
|
path_on_datastore
|
The relative path in the backing storage for the data reference. Default value: None
|
name
|
str, <xref:optional>
An optional name for the DataPath. Default value: None
|
datastore
Required
|
[Required] The Datastore to reference. |
path_on_datastore
Required
|
The relative path in the backing storage for the data reference. |
name
Required
|
str, <xref:optional>
An optional name for the DataPath. |
Remarks
The following example shows how to work create a DataPath and pass in arguments to it using PipelineParameter.
def_blob_store = ws.get_default_datastore()
print("Default datastore's name: {}".format(def_blob_store.name))
data_path = DataPath(datastore=def_blob_store, path_on_datastore='sample_datapath1')
datapath1_pipeline_param = PipelineParameter(name="input_datapath", default_value=data_path)
datapath_input = (datapath1_pipeline_param, DataPathComputeBinding(mode='mount'))
string_pipeline_param = PipelineParameter(name="input_string", default_value='sample_string1')
Full sample is available from https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-showcasing-datapath-and-pipelineparameter.ipynb
Methods
create_data_reference |
Create a DataReference object using this DataPath and the given DataPathComputeBinding. |
create_from_data_reference |
Create a DataPath from a DataReference. |
create_data_reference
Create a DataReference object using this DataPath and the given DataPathComputeBinding.
create_data_reference(data_reference_name=None, datapath_compute_binding=None)
Parameters
Name | Description |
---|---|
data_reference_name
|
The name for the data reference to create. Default value: None
|
datapath_compute_binding
|
[Required] The data path compute binding to use to create the data reference. Default value: None
|
Returns
Type | Description |
---|---|
A DataReference object. |
create_from_data_reference
Create a DataPath from a DataReference.
static create_from_data_reference(data_reference)
Parameters
Name | Description |
---|---|
data_reference
Required
|
[Required] The data reference to use to create data path. |
Returns
Type | Description |
---|---|
A DataPath object. |