Skip to content

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.

task_type class-attribute instance-attribute

task_type = Field(alias='taskType')

template class-attribute instance-attribute

template = Field(alias='template')

protection_status class-attribute instance-attribute

protection_status = Field(alias='protectionStatus')

description class-attribute instance-attribute

description = Field(alias='description')

created_at class-attribute instance-attribute

created_at = Field(alias='createdAt')

task_created_at class-attribute instance-attribute

task_created_at = Field(alias='taskCreatedAt')

execution_order class-attribute instance-attribute

execution_order = Field(alias='executionOrder')

published class-attribute instance-attribute

published = Field(alias='published')

disabled class-attribute instance-attribute

disabled = Field(alias='disabled')

legal_agreement_accepted class-attribute instance-attribute

legal_agreement_accepted = Field(
    alias="legalAgreementAccepted"
)

client class-attribute instance-attribute

client = Field(..., exclude=True)

id instance-attribute

id

Id of task.

pool_id instance-attribute

pool_id

Id of data pool where task is located.

job_id instance-attribute

job_id

Id of job where task is located.

task_id instance-attribute

task_id

name instance-attribute

name

Name of task.

data_pool_id property writable

data_pool_id

Returns id of data pool for given task.

Returns:

  • str

    Id of data pool.

from_transport classmethod

from_transport(client, task_instance_transport)

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

update()

Pushes local changes of task to EMS and updates properties with response from EMS.

sync

sync()

Syncs task properties with EMS.

delete

delete()

Deletes task.

enable

enable()

Enables task.

disable

disable()

Disables task.

get_task_variables

get_task_variables()

Gets task variables.

Returns:

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.

task_type class-attribute instance-attribute

task_type = Field(alias='taskType')

template class-attribute instance-attribute

template = Field(alias='template')

protection_status class-attribute instance-attribute

protection_status = Field(alias='protectionStatus')

name instance-attribute

name

Name of task.

description class-attribute instance-attribute

description = Field(alias='description')

created_at class-attribute instance-attribute

created_at = Field(alias='createdAt')

task_created_at class-attribute instance-attribute

task_created_at = Field(alias='taskCreatedAt')

execution_order class-attribute instance-attribute

execution_order = Field(alias='executionOrder')

published class-attribute instance-attribute

published = Field(alias='published')

disabled class-attribute instance-attribute

disabled = Field(alias='disabled')

legal_agreement_accepted class-attribute instance-attribute

legal_agreement_accepted = Field(
    alias="legalAgreementAccepted"
)

data_pool_id property writable

data_pool_id

Returns id of data pool for given task.

Returns:

  • str

    Id of data pool.

client class-attribute instance-attribute

client = Field(..., exclude=True)

id instance-attribute

id

Id of extraction.

pool_id instance-attribute

pool_id

Id of data pool where extraction is located.

job_id instance-attribute

job_id

Id of job where extraction is located.

task_id instance-attribute

task_id

from_transport classmethod

from_transport(client, task_instance_transport)

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

update()

Pushes local changes of task to EMS and updates properties with response from EMS.

sync

sync()

Syncs task properties with EMS.

delete

delete()

Deletes task.

enable

enable()

Enables task.

disable

disable()

Disables task.

get_task_variables

get_task_variables()

Gets task variables.

Returns:

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

create_table_extraction(
    table_name, schema_name=None, **kwargs
)

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:

get_table_extraction

get_table_extraction(id_)

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

get_table_extractions()

Gets all table extractions of given data job.

Returns:

Transformation

Bases: Task

Transformation object to interact with transformation specific data integration endpoints.

id instance-attribute

id

Id of task.

pool_id instance-attribute

pool_id

Id of data pool where task is located.

task_id instance-attribute

task_id

task_type class-attribute instance-attribute

task_type = Field(alias='taskType')

template class-attribute instance-attribute

template = Field(alias='template')

protection_status class-attribute instance-attribute

protection_status = Field(alias='protectionStatus')

name instance-attribute

name

Name of task.

description class-attribute instance-attribute

description = Field(alias='description')

job_id instance-attribute

job_id

Id of job where task is located.

created_at class-attribute instance-attribute

created_at = Field(alias='createdAt')

task_created_at class-attribute instance-attribute

task_created_at = Field(alias='taskCreatedAt')

execution_order class-attribute instance-attribute

execution_order = Field(alias='executionOrder')

published class-attribute instance-attribute

published = Field(alias='published')

disabled class-attribute instance-attribute

disabled = Field(alias='disabled')

legal_agreement_accepted class-attribute instance-attribute

legal_agreement_accepted = Field(
    alias="legalAgreementAccepted"
)

client class-attribute instance-attribute

client = Field(..., exclude=True)

data_pool_id property writable

data_pool_id

Returns id of data pool for given task.

Returns:

  • str

    Id of data pool.

from_transport classmethod

from_transport(client, task_instance_transport)

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

update()

Pushes local changes of task to EMS and updates properties with response from EMS.

sync

sync()

Syncs task properties with EMS.

delete

delete()

Deletes task.

enable

enable()

Enables task.

disable

disable()

Disables task.

get_task_variables

get_task_variables()

Gets task variables.

Returns:

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

get_statement

get_statement()

Gets statement of task.

update_statement

update_statement(statement)

Updates statement of task.

Parameters:

  • statement (str) –

    new statement of task.