Error while accessing the dataset from a datastore

G, Koshy 106 Reputation points
2021-04-29T12:16:39.813+00:00

I have tried to read the dataset from datastore. Also tried to create the dataset also.

The code for reading the dataset is below

from azureml.core import Workspace
ws = Workspace.from_config()
datastore = Datastore.get(ws, 'qdataset')

It works fine still now.

from azureml.core.dataset import Dataset
six_dataset = Dataset.get_by_name(workspace=ws, name='combined_classifier')

Also i have tried from azureml.core import Dataset

It shows the following error:

2021-04-29 11:56:47.284077 | ActivityCompleted: Activity=_dataflow, HowEnded=Failure, Duration=0.0 [ms], Info = {'activity_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'activity_name': '_dataflow', 'activity_type': 'InternalCall', 'app_name': 'dataset', 'source': 'azureml.dataset', 'version': '1.27.0', 'dataprepVersion': '2.14.2', 'subscription': '', 'run_id': '', 'resource_group': '', 'workspace_name': '', 'experiment_id': '', 'location': '', 'completionStatus': 'Failure', 'durationMs': 962.01}, Exception=AttributeError; module 'azureml.dataprep' has no attribute 'api'


AttributeError Traceback (most recent call last)
<ipython-input-34-ac7a8d35da4d> in <module>
1 from azureml.core.dataset import Dataset
----> 2 six_dataset = Dataset.get_by_name(workspace=ws, name='combined_classifier')

~\AppData\Roaming\Python\Python38\site-packages\azureml\data_loggerfactory.py in wrapper(*args, **kwargs)
127 with _LoggerFactory.track_activity(logger, func.name, activity_type, custom_dimensions) as al:
128 try:
--> 129 return func(*args, **kwargs)
130 except Exception as e:
131 if hasattr(al, 'activity_info') and hasattr(e, 'error_code'):

~\AppData\Roaming\Python\Python38\site-packages\azureml\data\abstract_dataset.py in get_by_name(workspace, name, version)
87 :rtype: typing.Union[azureml.data.TabularDataset, azureml.data.FileDataset]
88 """
---> 89 dataset = AbstractDataset._get_by_name(workspace, name, version)
90 AbstractDataset._track_lineage([dataset])
91 return dataset

~\AppData\Roaming\Python\Python38\site-packages\azureml\data\abstract_dataset.py in _get_by_name(workspace, name, version)
652 if not success:
653 raise result
--> 654 dataset = _dto_to_dataset(workspace, result)
655 warn_deprecated_blocks(dataset)
656 return dataset

~\AppData\Roaming\Python\Python38\site-packages\azureml\data_dataset_rest_helper.py in _dto_to_dataset(workspace, dto)
93 registration=registration)
94 if dto.dataset_type == _DATASET_TYPE_FILE:
---> 95 return FileDataset._create(
96 definition=dataflow_json,
97 properties=dto.latest.properties,

~\AppData\Roaming\Python\Python38\site-packages\azureml\data_loggerfactory.py in wrapper(*args, **kwargs)
127 with _LoggerFactory.track_activity(logger, func.name, activity_type, custom_dimensions) as al:
128 try:
--> 129 return func(*args, **kwargs)
130 except Exception as e:
131 if hasattr(al, 'activity_info') and hasattr(e, 'error_code'):

~\AppData\Roaming\Python\Python38\site-packages\azureml\data\abstract_dataset.py in _create(cls, definition, properties, registration, telemetry_info)
555 from azureml.data._partition_format import parse_partition_format
556
--> 557 steps = dataset._dataflow._get_steps()
558 partition_keys = []
559 for step in steps:

~\AppData\Roaming\Python\Python38\site-packages\azureml\data_loggerfactory.py in wrapper(*args, **kwargs)
127 with _LoggerFactory.track_activity(logger, func.name, activity_type, custom_dimensions) as al:
128 try:
--> 129 return func(*args, **kwargs)
130 except Exception as e:
131 if hasattr(al, 'activity_info') and hasattr(e, 'error_code'):

~\AppData\Roaming\Python\Python38\site-packages\azureml\data\abstract_dataset.py in _dataflow(self)
215 raise UserErrorException('Dataset definition is missing. Please check how the dataset is created.')
216 if self._registration and self._registration.workspace:
--> 217 dataprep().api._datastore_helper._set_auth_type(self._registration.workspace)
218 if not isinstance(self._definition, dataprep().Dataflow):
219 try:

AttributeError: module 'azureml.dataprep' has no attribute 'api'

Please give a solution to solve this

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
1,650 questions
No comments
1 vote

Accepted answer
  1. G, Koshy 106 Reputation points
    2021-04-29T13:22:51.567+00:00

    It now worked..
    We need to install azure-ml-api-sdk using this command

    pip install azure-ml-api-sdk

    No comments

0 additional answers

Sort by: Most helpful