from airsql import sql
@sql.dataframe(source_conn='postgres_conn')
def get_active_users():
return 'SELECT * FROM users WHERE active = true'
# Use in DAG
df_task = get_active_users()AirSQL
A decorator-based SQL execution framework for Apache Airflow.
Decorated Python functions define SQL tasks in an Airflow DAG and can return a DataFrame, write to a table, or save to a file.