task
Module to interact with tasks.
This module contains class to interact with a task in EMS data integration.
Typical usage example:
```python
task = data_job.create_task(
"TEST_TASK",
TaskType.TRANSFORMATION,
"TEST_DESCRIPTION",
)
transformation = data_job.create_transformation(
"TEST_TRANSFORMATION"
)
transformation.delete()
```
Task ¶
Bases: TaskInstanceTransport
Task object to interact with task specific data integration endpoints.
protection_status
class-attribute
instance-attribute
¶
task_created_at
class-attribute
instance-attribute
¶
execution_order
class-attribute
instance-attribute
¶
legal_agreement_accepted
class-attribute
instance-attribute
¶
data_pool_id
property
writable
¶
Returns id of data pool for given task.
Returns:
-
str–Id of data pool.
from_transport
classmethod
¶
Creates high-level task object from given TaskTransport.
Parameters:
-
client(Client) –Client to use to make API calls for given job.
-
task_instance_transport(TaskInstanceTransport) –TaskInstanceTransport object containing properties of task.
Returns:
-
Task–A Task object with properties from transport and given client.
update ¶
Pushes local changes of task to EMS and updates properties with response from EMS.
get_task_variables ¶
Gets task variables.
Returns:
-
CelonisCollection[TaskVariable]–A list containing all task variables.
create_task_variable ¶
create_task_variable(
name,
placeholder,
description=None,
var_type=VariableType.PUBLIC_CONSTANT,
data_type=FilterParserDataType.STRING,
values=None,
settings=None,
**kwargs
)
Creates and returns newly created task variable.
Parameters:
-
name(str) –name of a variable.
-
placeholder(str) –placeholder of a variable.
-
description(Optional[str], default:None) –description of a variable.
-
var_type(VariableType, default:PUBLIC_CONSTANT) –type of a variable.
-
data_type(FilterParserDataType, default:STRING) –type of value of a variable.
-
values(Optional[List[VariableValueTransport]], default:None) –list of values.
-
settings(Optional[VariableSettingsTransport], default:None) –if not none contains pool variable id used to extract value of variable.
-
**kwargs(Any, default:{}) –Additional parameters
Extraction ¶
Bases: Task
Extraction object to interact with extraction specific data integration endpoints.
protection_status
class-attribute
instance-attribute
¶
task_created_at
class-attribute
instance-attribute
¶
execution_order
class-attribute
instance-attribute
¶
legal_agreement_accepted
class-attribute
instance-attribute
¶
data_pool_id
property
writable
¶
Returns id of data pool for given task.
Returns:
-
str–Id of data pool.
from_transport
classmethod
¶
Creates high-level task object from given TaskTransport.
Parameters:
-
client(Client) –Client to use to make API calls for given job.
-
task_instance_transport(TaskInstanceTransport) –TaskInstanceTransport object containing properties of task.
Returns:
-
Task–A Task object with properties from transport and given client.
update ¶
Pushes local changes of task to EMS and updates properties with response from EMS.
get_task_variables ¶
Gets task variables.
Returns:
-
CelonisCollection[TaskVariable]–A list containing all task variables.
create_task_variable ¶
create_task_variable(
name,
placeholder,
description=None,
var_type=VariableType.PUBLIC_CONSTANT,
data_type=FilterParserDataType.STRING,
values=None,
settings=None,
**kwargs
)
Creates and returns newly created task variable.
Parameters:
-
name(str) –name of a variable.
-
placeholder(str) –placeholder of a variable.
-
description(Optional[str], default:None) –description of a variable.
-
var_type(VariableType, default:PUBLIC_CONSTANT) –type of a variable.
-
data_type(FilterParserDataType, default:STRING) –type of value of a variable.
-
values(Optional[List[VariableValueTransport]], default:None) –list of values.
-
settings(Optional[VariableSettingsTransport], default:None) –if not none contains pool variable id used to extract value of variable.
-
**kwargs(Any, default:{}) –Additional parameters
create_table_extraction ¶
Creates table extraction in given data job.
Parameters:
-
table_name(str) –Name of table to extract.
-
schema_name(Optional[str], default:None) –Name of schema where table is located.
-
**kwargs(Any, default:{}) –Additional parameters set for TableExtractionTransport object.
Returns:
-
TableExtraction–A TableExtraction object for newly created table extraction.
Raises:
-
PyCelonisValueError–Raised if something went wrong creating the table extraction.
get_table_extraction ¶
Gets table extraction with given id.
Parameters:
-
id_(str) –Id of table extraction.
Returns:
-
TableExtraction–A TableExtraction object for table extraction with given id.
get_table_extractions ¶
Gets all table extractions of given data job.
Returns:
-
CelonisCollection[Optional[TableExtraction]]–A list containing all table extractions.
Transformation ¶
Bases: Task
Transformation object to interact with transformation specific data integration endpoints.
protection_status
class-attribute
instance-attribute
¶
task_created_at
class-attribute
instance-attribute
¶
execution_order
class-attribute
instance-attribute
¶
legal_agreement_accepted
class-attribute
instance-attribute
¶
data_pool_id
property
writable
¶
Returns id of data pool for given task.
Returns:
-
str–Id of data pool.
from_transport
classmethod
¶
Creates high-level task object from given TaskTransport.
Parameters:
-
client(Client) –Client to use to make API calls for given job.
-
task_instance_transport(TaskInstanceTransport) –TaskInstanceTransport object containing properties of task.
Returns:
-
Task–A Task object with properties from transport and given client.
update ¶
Pushes local changes of task to EMS and updates properties with response from EMS.
get_task_variables ¶
Gets task variables.
Returns:
-
CelonisCollection[TaskVariable]–A list containing all task variables.
create_task_variable ¶
create_task_variable(
name,
placeholder,
description=None,
var_type=VariableType.PUBLIC_CONSTANT,
data_type=FilterParserDataType.STRING,
values=None,
settings=None,
**kwargs
)
Creates and returns newly created task variable.
Parameters:
-
name(str) –name of a variable.
-
placeholder(str) –placeholder of a variable.
-
description(Optional[str], default:None) –description of a variable.
-
var_type(VariableType, default:PUBLIC_CONSTANT) –type of a variable.
-
data_type(FilterParserDataType, default:STRING) –type of value of a variable.
-
values(Optional[List[VariableValueTransport]], default:None) –list of values.
-
settings(Optional[VariableSettingsTransport], default:None) –if not none contains pool variable id used to extract value of variable.
-
**kwargs(Any, default:{}) –Additional parameters
update_statement ¶
Updates statement of task.
Parameters:
-
statement(str) –new statement of task.