async_run_status() | Teradata Package for Python - async_run_status() - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-04-09
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Use the async_run_status() function to check the status of asynchronous run(s) using the unique run id(s).

Required argument:
  • run_ids: Specifies the unique identifier(s) of the asynchronous run.

The following examples use the async_run_status() function to show the status of asynchronous run id for OpenAF.

Example 1: Get the status of a single async run id

This example gets the status of an environment that has been removed asynchronously.

>>> from teradataml import create_env, remove_env, async_run_status
>>> env = create_env("testenv1", "python_3.7.13","test env 1")
User environment 'testenv1' created.
>>> remove_env("testenv1", asynchronous=True)
Request to remove environment initiated successfully. Check the status using list_user_envs(). If environment is not removed, check the status of asynchronous call using async_run_status('1ba43e0a-4285-41e1-8738-5f8895c180ee') or get_env('testenv1').status('1ba43e0a-4285-41e1-8738-5f8895c180ee')
'1ba43e0a-4285-41e1-8738-5f8895c180ee'
>>> async_run_status('1ba43e0a-4285-41e1-8738-5f8895c180ee')
                                 Run Id                      Run Description    Status             Timestamp Additional Details
0  1ba43e0a-4285-41e1-8738-5f8895c180ee  Remove 'testenv1' user environment.   Started  2023-08-31T09:27:06Z

Example 2: Get the status of multiple async run ids

This example gets the status of multiple asynchronous run ids for removed environments.

>>> env1 = create_env("testenv1", "python_3.7.13","test env 1")
>>> env2 = create_env("testenv2", "python_3.7.13","test env 2")
User environment 'testenv1' created.
User environment 'testenv2' created.
# Remove 'testenv1' environment asynchronously.
>>> remove_env("testenv1", asynchronous=True)
Request to remove environment initiated successfully. Check the status using list_user_envs(). If environment is not removed, check the status of asynchronous call using async_run_status('24812988-b124-45c7-80b1-6a4a826dc110') or get_env('testenv1').status('24812988-b124-45c7-80b1-6a4a826dc110')
'24812988-b124-45c7-80b1-6a4a826dc110'
# Remove 'testenv2' environment asynchronously.
>>> remove_env("testenv2", asynchronous=True)
Request to remove environment initiated successfully. Check the status using list_user_envs(). If environment is not removed, check the status of asynchronous call using async_run_status('f686d756-58bb-448b-81e2-979155cb8140') or get_env('testenv2').status('f686d756-58bb-448b-81e2-979155cb8140')
'f686d756-58bb-448b-81e2-979155cb8140'
# Check the status of claim IDs for asynchronously installed libraries and removed environments.
>>> async_run_status(['24812988-b124-45c7-80b1-6a4a826dc110', 'f686d756-58bb-448b-81e2-979155cb8140'])
                                  Run Id                       Run Description    Status               Timestamp    Additional Details
0   24812988-b124-45c7-80b1-6a4a826dc110    Remove 'testenv1' user environment.  Started    2023-08-31T04:00:44Z
1   24812988-b124-45c7-80b1-6a4a826dc110    Remove 'testenv1' user environment. Finished    2023-08-31T04:00:45Z
2   f686d756-58bb-448b-81e2-979155cb8140    Remove 'testenv2' user environment.  Started    2023-08-31T04:00:47Z
3   f686d756-58bb-448b-81e2-979155cb8140    Remove 'testenv2' user environment. Finished    2023-08-31T04:00:48Z