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.

Inheritance
DataPath

Constructor

DataPath(datastore=None, path_on_datastore=None, name=None)

Parameters

datastore
AbstractAzureStorageDatastore or AzureDataLakeDatastore

[Required] The Datastore to reference.

path_on_datastore
str

The relative path in the backing storage for the data reference.

name
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

data_reference_name
str
default value: None

The name for the data reference to create.

datapath_compute_binding
DataPathComputeBinding
default value: None

[Required] The data path compute binding to use to create the data reference.

Returns

A DataReference object.

Return type

create_from_data_reference

Create a DataPath from a DataReference.

create_from_data_reference(data_reference)

Parameters

data_reference
DataReference

[Required] The data reference to use to create data path.

Returns

A DataPath object.

Return type

Attributes

datastore_name

Get the name of the datastore.

Returns

The name.

Return type

path_on_datastore

Get the path on datastore.

Returns

The path.

Return type