Get Dataset File Status
Get the status of dataset file upload
Introduction
You can retrieve the status of the files that were uploaded to your dataset by calling GetDatasetFileStatus. You can access the status of the files through the files attribute on the Dataset object, which is a list of Datafile objects.
GetDatasetFileStatus
Inputs
GetDatasetFileStatus (query) InputsImported from:
from indico.queries.datasets import GetDatasetFileStatus
id: intThe ID of the Dataset. (required)
Output
GetDatasetFileStatus (query) Ouputs
DatasetObject. See Creating a Dataset for more information)
Try It Out
Try out GetDatasetFileStatus using the code below:
from indico import IndicoClient, IndicoConfig
from indico.queries.datasets import CreateDataset, GetDatasetFileStatus
from indico.types.dataset import Dataset
my_config = IndicoConfig(
host="your-cluser.example.com", api_token_path="./indico_api_token.txt"
)
client = IndicoClient(config=my_config)
dataset_filepaths = [
"/path/to/file/file1.pdf", "/path/to/file/file2.pdf", "/path/to/file/file3.pdf"
]
response: Dataset = client.call(
CreateDataset( # CreateDataset waits for the dataset to finish processing the files by default
name="pdf-dataset",
files=dataset_filepaths,
dataset_type="DOCUMENT",
wait=False
)
)
#Get the ID from the Dataset Object returned from CreateDataset
#and manually call GetDatasetFileStatus to retrieve the status of the files that were uploaded.```
dataset: Dataset = client.call(
GetDatasetFileStatus(id=response.id)
)
Updated 6 months ago
