astro.sql.operators.append

Module Contents

Classes

AppendOperator

Append the source table rows into a destination table.

Functions

append(*, source_table, target_table[, columns])

Append the source table rows into a destination table.

class astro.sql.operators.append.AppendOperator(source_table, target_table, columns=None, task_id='', **kwargs)

Bases: airflow.models.baseoperator.BaseOperator

Append the source table rows into a destination table.

Parameters
  • source_table (astro.sql.table.Table) – Contains the rows to be appended to the target_table (templated)

  • target_table (astro.sql.table.Table) – Contains the destination table in which the rows will be appended (templated)

  • columns (list[str] | tuple[str] | dict[str, str] | None) – List/Tuple of columns if name of source and target tables are same. If the column names in source and target tables are different pass a dictionary of source_table columns names to target_table columns names. Examples: ["sell", "list"] or {"s_sell": "t_sell", "s_list": "t_list"}

  • task_id (str) –

  • kwargs (Any) –

template_fields = ['source_table', 'target_table']
execute(context)

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Parameters

context (dict) –

Return type

astro.sql.table.Table

astro.sql.operators.append.append(*, source_table, target_table, columns=None, **kwargs)

Append the source table rows into a destination table.

Parameters
  • source_table (astro.sql.table.Table) – Contains the rows to be appended to the target_table (templated)

  • target_table (astro.sql.table.Table) – Contains the destination table in which the rows will be appended (templated)

  • columns (list[str] | tuple[str] | dict[str, str] | None) – List/Tuple of columns if name of source and target tables are same. If the column names in source and target tables are different pass a dictionary of source_table columns names to target_table columns names. Examples: ["sell", "list"] or {"s_sell": "t_sell", "s_list": "t_list"}

  • kwargs (Any) – Any keyword arguments supported by the BaseOperator is supported (e.g queue, owner)

Return type

airflow.models.xcom_arg.XComArg