tasks
cloud.tasks
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 too. |
| 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
cloud.tasks.fetch_results(task_id, *, result_format=None)Fetches the results of a previously-executed UDF or SQL query.
fetch_results_pandas
cloud.tasks.fetch_results_pandas(
task_id,
*,
result_format=models.ResultFormat.NATIVE,
)Fetches the results of a previously-executed UDF or SQL query.
fetch_tasks
cloud.tasks.fetch_tasks(
namespace=None,
array=None,
start=None,
end=datetime.datetime.now(datetime.timezone.utc),
status=None,
page=None,
per_page=None,
async_req=False,
)Fetch all tasks a user has access too.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| namespace | str | optional filter by namespace | None |
| array | str | optional limit tasks to specific array | None |
| start | datetime | optional start time for listing of tasks, defaults to 7 days ago | None |
| end | datetime | optional end time for listing of tasks defaults to now | datetime.datetime.now(datetime.timezone.utc) |
| status | str | optional filter on status can be one of [‘FAILED’, ‘RUNNING’, ‘COMPLETED’] | None |
| page | int | optional page for pagenating results | None |
| per_page | int | optional records to return per page | None |
| async_req | return future instead of results for async support | False |
Returns
| Name | Type | Description |
|---|---|---|
| Dict[str, Sequence[Dict[str, Any]]] | Mapping of task data organized by task type. |
last_sql_task
cloud.tasks.last_sql_task()Fetch the last run sql array task
Returns
| Name | Type | Description |
|---|---|---|
| object with task details |
last_udf_task
cloud.tasks.last_udf_task()Fetch the last run udf task
Returns
| Name | Type | Description |
|---|---|---|
| object with task details |
task
cloud.tasks.task(id, async_req=False)Fetch a single array task
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| id | str | id to lookup | required |
| async_req | return future instead of results for async support | False |
Returns
| Name | Type | Description |
|---|---|---|
| object with task details |