Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 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",
)
# 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}",
)
# 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 }}}};
# 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 }}}};