Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def download_dataset(self, dataset_id: str) -> (str, str, Union[str, None]):
is_adt = 'AZURE_DIGITAL_TWINS_URL' in parameters
is_storage = 'AZURE_STORAGE_CONTAINER_BLOB_PREFIX' in parameters
is_legacy_twin_cache = 'TWIN_CACHE_NAME' in parameters and dataset.twingraph_id is None # Legacy twingraph dataset with specific connector
is_in_workspace_file = 'workspaceFile' in dataset.tags

if is_adt:
return {
Expand All @@ -137,6 +138,16 @@ def download_dataset(self, dataset_id: str) -> (str, str, Union[str, None]):
"content": _content,
"name": dataset.name
}
elif is_in_workspace_file:
_file_name = dataset.source.location
_content = self._download_file(_file_name)
self.dataset_file_temp_path[dataset_id] = self.dataset_file_temp_path[_file_name]
return {
"type": _file_name.split('.')[-1],
"content": _content,
"name": dataset.name
}

else:
return {
"type": "twincache",
Expand Down
2 changes: 1 addition & 1 deletion CosmoTech_Acceleration_Library/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Cosmo Tech corporation.
# Licensed under the MIT license.

__version__ = '0.8.4'
__version__ = '0.8.5'
8 changes: 6 additions & 2 deletions cosmotech/coal/cli/commands/api/run_load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import pathlib
from shutil import copytree

from cosmotech_api.api.dataset_api import DatasetApi
from cosmotech_api.api.runner_api import RunnerApi
from cosmotech_api.api.workspace_api import WorkspaceApi

Expand All @@ -35,11 +34,16 @@ def download_runner_data(organization_id: str, workspace_id: str, runner_id: str
_dl = ScenarioDownloader(workspace_id=workspace_id, organization_id=organization_id, read_files=False)
with get_api_client()[0] as api_client:
runner_api_instance = RunnerApi(api_client)
dataset_api_instance = DatasetApi(api_client)
workspace_api_instance = WorkspaceApi(api_client)
runner_data = runner_api_instance.get_runner(organization_id=organization_id,
workspace_id=workspace_id,
runner_id=runner_id)

# skip if no parameters found
if not runner_data.parameters_values:
LOGGER.warning('no parameters found in the runner')
return

LOGGER.info("Loaded run data")
# Pre-read of all workspace files to ensure ready to download AZ storage files
all_api_files = workspace_api_instance.find_all_workspace_files(
Expand Down
Loading