Source code for operators.transform_postgres
from operators.base_transform import BaseTransformOperator
[docs]
class TransformPostgresOperator(BaseTransformOperator):
"""
Transform data from one Postgres connection to another Postgres Connection.
:param source_conn_id: the source Postgres connection ID
:type source_conn_id: str
:param source_sql: the source SQL statement. Should return the data to be
saved to the destination. (templated)
:type source_sql: str
:param dest_conn_id: the destination Postgres connection ID
:type dest_conn_id: str
:param dest_schema_name: the name of the destination schema
:type dest_schema_name: str
:param dest_table_name: the name of the destination table
:type dest_table_name: str
:param truncate: whether to truncate the destination table
:type truncate: bool
:param if_table_exists: what to do if destination table exists. Can be ``fail``, ``append``, ``replace``. Default ``fail``.
:type if_table_exists: str
:param query_limit: how many rows to pass in each chunk
:type query_limit: int
"""
ui_color = "#f542d7"