Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
-------
Type
New operator class
"""
from flowetl.mixins.fixed_sql_mixin import FixedSQLMixin
from flowetl.mixins.table_name_macros_mixin import TableNameMacrosMixin
if is_sensor:
from airflow.sensors.sql_sensor import SqlSensor as op_base
else:
from airflow.operators.postgres_operator import PostgresOperator as op_base
return type(
class_name,
(TableNameMacrosMixin, ParamsMixin, FixedSQLMixin, op_base),
dict(fixed_sql=sql, named_params=params),
)