Add warning when opening an aborted Dataset

This commit is contained in:
allegroai 2021-11-26 16:39:53 +02:00
parent 62a175a243
commit 9824256b61

View File

@ -77,6 +77,9 @@ class Dataset(object):
task_status = task.data.status task_status = task.data.status
# if we are continuing aborted Task, force the state # if we are continuing aborted Task, force the state
if str(task_status) == 'stopped': if str(task_status) == 'stopped':
# print warning that we are opening a stopped dataset:
LoggerRoot.get_base_logger().warning(
'Reopening aborted Dataset, any change will clear and overwrite current state')
task.mark_started(force=True) task.mark_started(force=True)
task_status = 'in_progress' task_status = 'in_progress'
@ -603,7 +606,7 @@ class Dataset(object):
# type: (Optional[str], bool, Optional[str]) -> List[str] # type: (Optional[str], bool, Optional[str]) -> List[str]
""" """
returns a list of files in the current dataset returns a list of files in the current dataset
If dataset_id is give, return a list of files that remained unchanged since the specified dataset_version If dataset_id is provided, return a list of files that remained unchanged since the specified dataset_version
:param dataset_path: Only match files matching the dataset_path (including wildcards). :param dataset_path: Only match files matching the dataset_path (including wildcards).
Example: 'folder/sub/*.json' Example: 'folder/sub/*.json'