tasks
client.tasks
Access to information about TileDB tasks.
Classes
| Name | Description |
|---|---|
| TasksError | Raised when tasks can not be accessed. |
TasksError
client.tasks.TasksError()Raised when tasks can not be accessed.
Functions
| Name | Description |
|---|---|
| fetch_results | Fetches the results of a previously-executed UDF or SQL query. |
| fetch_results_pandas | Fetches the results of a previously-executed UDF or SQL query. |
| fetch_tasks | Fetch all tasks a user has access to. |
| last_sql_task | Fetch the last run sql array task |
| last_udf_task | Fetch the last run udf task |
| task | Fetch a single array task. |
fetch_results
client.tasks.fetch_results(task_id, *, result_format=None)Fetches the results of a previously-executed UDF or SQL query.
fetch_results_pandas
client.tasks.fetch_results_pandas(
task_id,
*,
result_format=models.ResultFormat.NATIVE,
)Fetches the results of a previously-executed UDF or SQL query.
fetch_tasks
client.tasks.fetch_tasks(
query=None,
array=None,
teamspace=None,
start=None,
end=datetime.datetime.now(datetime.timezone.utc),
status=None,
type=None,
exclude_type=None,
file_type=None,
exclude_file_type=None,
order_by=None,
page=1,
per_page=None,
)Fetch all tasks a user has access to.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| query | str | Query keywords. | None |
| array | AssetLike | Filter for a specific array. | None |
| teamspace | TeamspaceLike | Filter for a specific teamspaces, specified by object or id. | None |
| start | datetime | Start time for listing of tasks, defaults to 7 days ago. | None |
| end | datetime end | End time for listing of tasks. Defaults to now(). | datetime.datetime.now(datetime.timezone.utc) |
| status | ArrayTaskStatus | Filter on status, one of ‘FAILED’, ‘RUNNING’, ‘COMPLETED’. | None |
| type | ArrayTaskType | One of ‘QUERY’, ‘SQL’, ‘UDF’, or ‘GENERIC_UDF’. | None |
| exclude_type | list[ArrayTaskType] | Exclude type of task arrays from matches, more than one can be included. | None |
| file_type | list[str] | Match file_type of task array, more than one can be included. | None |
| exclude_file_type | list[str] | Exclude file_type of task arrays from matches, more than one can be included. | None |
| order_by | str | Sort by which field valid values include start_time, name. | None |
| page | int | Which page of results to retrieve. 1-based. | 1 |
| per_page | int | How many results to include on each page. | None |
Returns
| Name | Type | Description |
|---|---|---|
| Pager for ArrayTasks |
Raises
| Name | Type | Description |
|---|---|---|
| TasksError | Raised when tasks can not be accessed. |
Examples
>>> for task in fetch_tasks(status='RUNNING', start=datetime.datetime.now() - datetime.timedelta(hours=3))
... print(task.id, task.start_time
...This prints the id and start time of all running tasks in the last 3 hours.
last_sql_task
client.tasks.last_sql_task()Fetch the last run sql array task :return task : object with task details
last_udf_task
client.tasks.last_udf_task()Fetch the last run udf task :return task : object with task details
task
client.tasks.task(id, async_req=False)Fetch a single array task.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| id | str | The id to look up. | required |
Return
ArrayTask Object with task details.
Raises
| Name | Type | Description |
|---|---|---|
| TasksError | Raised when task can not be accessed. |