DataPath class

Definition

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.

DataPath(datastore=None, path_on_datastore=None, name=None)
Inheritance
builtins.object
DataPath

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, 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(data_reference_name=None, datapath_compute_binding=None)

Create a DataReference object using this DataPath and the given DataPathComputeBinding.

create_from_data_reference(data_reference)

Create a DataPath from a DataReference.

create_data_reference(data_reference_name=None, datapath_compute_binding=None)

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

The name for the data reference to create.

default value: None
datapath_compute_binding
DataPathComputeBinding

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

default value: None

Returns

A DataReference object.

Return type

create_from_data_reference(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