Skip to content

Commit

Permalink
added arguments to azuremldataasset in order to be able to specify th…
Browse files Browse the repository at this point in the history
…e path within azureml where the dataset is saved
  • Loading branch information
Gabriel2409 committed Sep 14, 2023
1 parent 5ae7bcf commit d507682
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions kedro_azureml/datasets/asset_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def __init__(
self,
azureml_dataset: str,
dataset: Union[str, Type[AbstractDataSet], Dict[str, Any]],
datastore: str = "workspaceblobstore",
azureml_root_dir: str = "kedro_azureml", # maybe combine with root_dir?
root_dir: str = "data",
filepath_arg: str = "filepath",
azureml_type: AzureMLDataAssetType = "uri_folder",
Expand All @@ -93,6 +95,8 @@ def __init__(
"""
super().__init__(dataset=dataset, root_dir=root_dir, filepath_arg=filepath_arg)

self._azureml_root_dir = azureml_root_dir
self._datastore = datastore
self._azureml_dataset = azureml_dataset
self._version = version
# 1 entry for load version, 1 for save version
Expand Down
6 changes: 5 additions & 1 deletion kedro_azureml/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ def _get_output(self, name):
"AzureMLAssetDataSets with azureml_type 'uri_file' cannot be used as outputs"
)
# TODO: add versioning
return Output(type=ds._azureml_type, name=ds._azureml_dataset)
return Output(
type=ds._azureml_type,
name=ds._azureml_dataset,
path=f"azureml://datastores/{ds._datastore}/paths/{ds._azureml_root_dir}/{ds.resolve_save_version()}",
)
else:
return Output(type="uri_folder")

Expand Down

0 comments on commit d507682

Please sign in to comment.