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.fixed_sql_mixin import fixed_sql_operator
UpdateETLTableOperator = fixed_sql_operator(
class_name="UpdateETLTableOperator",
sql="""
INSERT INTO etl.etl_records (cdr_type, cdr_date, state, timestamp) VALUES ('{{ params.cdr_type }}', '{{ ds }}'::DATE, 'ingested', NOW());
# 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.fixed_sql_mixin import fixed_sql_operator
DataPresentSensor = fixed_sql_operator(
class_name="DataPresentSensor",
sql="SELECT * FROM {{ staging_table }} LIMIT 1;",
is_sensor=True,
)
# 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.fixed_sql_mixin import fixed_sql_operator
AddConstraintsOperator = fixed_sql_operator(
class_name="AddConstraintsOperator",
sql="""
ALTER TABLE {{ 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.fixed_sql_mixin import fixed_sql_operator
AttachOperator = fixed_sql_operator(
class_name="AttachOperator",
sql="""
DROP TABLE IF EXISTS {{ final_table }};