How to use the flowetl.mixins.wrapping_sql_mixin.wrapped_sql_operator function in flowetl

To help you get started, we’ve selected a few flowetl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flowminder / FlowKit / flowetl / flowetl / flowetl / operators / qa_check_operator.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from flowetl.mixins.wrapping_sql_mixin import wrapped_sql_operator

QACheckOperator = wrapped_sql_operator(
    sql="""INSERT INTO etl.post_etl_queries(cdr_date, cdr_type, type_of_query_or_check, outcome, timestamp) 
            VALUES
        (date '{{{{ ds }}}}', '{{{{ params.cdr_type }}}}', '{{{{ task.task_id }}}}', ({sql}), NOW())
    """,
    class_name="QACheckOperator",
)
github Flowminder / FlowKit / flowetl / flowetl / flowetl / operators / create_staging_view_operator.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from flowetl.mixins.wrapping_sql_mixin import wrapped_sql_operator

CreateStagingViewOperator = wrapped_sql_operator(
    class_name="CreateStagingViewOperator",
    sql="CREATE OR REPLACE VIEW {{{{ staging_table }}}} AS {sql}",
)
github Flowminder / FlowKit / flowetl / flowetl / flowetl / operators / extract_from_foreign_table_operator.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from flowetl.mixins.wrapping_sql_mixin import wrapped_sql_operator

ExtractFromForeignTableOperator = wrapped_sql_operator(
    class_name="ExtractFromForeignTableOperator",
    sql="""
        DROP TABLE IF EXISTS {{{{ extract_table }}}};
github Flowminder / FlowKit / flowetl / flowetl / flowetl / operators / extract_from_view_operator.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from flowetl.mixins.wrapping_sql_mixin import wrapped_sql_operator

ExtractFromViewOperator = wrapped_sql_operator(
    class_name="ExtractFromViewOperator",
    sql="""
        DROP TABLE IF EXISTS {{{{ extract_table }}}};