Registry / workflow / apache-airflow-providers-trino

apache-airflow-providers-trino

JSON →
library6.6.1pypypi✓ verified 23d ago

The `apache-airflow-providers-trino` package provides Apache Airflow users with hooks, operators, and transfers to interact with Trino (formerly PrestoSQL). It enables programmatic orchestration of Trino SQL queries within Airflow DAGs, facilitating ETL and data pipeline workflows. The current version is 6.5.1, and the provider follows a strict Semantic Versioning policy with frequent releases independent of Airflow core.

pip install apache-airflow-providers-trino
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-trino
workflowpythonv6.6.1
Install
30.2s avg
Import
5304ms
Disk
401MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v6.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 30.2s · import 5.304s · 420MB
401MB installed
● package 401MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TrinoHook
from airflow.providers.trino.hooks.trino import TrinoHook
TrinoOperator
from airflow.providers.trino.operators.trino import TrinoOperator
from trino_operator import TrinoOperator
The operator is part of the Airflow provider package, not a top-level module.
TrinoToS3Operator
from airflow.providers.trino.transfers.trino_to_s3 import TrinoToS3Operator

This quickstart demonstrates a basic Airflow DAG that uses the `TrinoOperator` to interact with a Trino cluster. It includes tasks for creating a table, inserting data, and selecting data. Ensure you configure a 'Trino' connection in the Airflow UI with the ID `trino_default` before running this DAG.

import os import pendulum from airflow.models.dag import DAG from airflow.providers.trino.operators.trino import TrinoOperator # Configure Trino Connection in Airflow UI: # Conn Id: 'trino_default' # Conn Type: Trino # Host: <your_trino_host> # Port: <your_trino_port> # Schema: <your_trino_schema> # User: <your_trino_user> # Password: <your_trino_password> (optional) # Extra: {'protocol': 'https', 'verify': 'false'} (example for HTTPS/self-signed) with DAG( dag_id='trino_example_dag', start_date=pendulum.datetime(2023, 1, 1, tz='UTC'), catchup=False, schedule=None, tags=['trino', 'example'], ) as dag: create_test_table = TrinoOperator( task_id='create_test_table', trino_conn_id='trino_default', sql=""" CREATE TABLE IF NOT EXISTS memory.default.airflow_test ( id INT, name VARCHAR ) """, handler=lambda _: None, # For DDL, handler is often not needed or can be a no-op ) insert_data = TrinoOperator( task_id='insert_data', trino_conn_id='trino_default', sql=""" INSERT INTO memory.default.airflow_test (id, name) VALUES (1, 'Airflow'), (2, 'Trino') """, handler=lambda _: None, ) select_data = TrinoOperator( task_id='select_data', trino_conn_id='trino_default', sql="SELECT * FROM memory.default.airflow_test", ) create_test_table >> insert_data >> select_data
airflow --version
Debug
Known issues
breakingThe minimum required Apache Airflow version for `apache-airflow-providers-trino` frequently increases with new provider releases. For version 6.5.1, Airflow 2.11.0 or newer is required. Installing this provider on an older Airflow version (e.g., <2.11.0) may automatically upgrade your Airflow core, potentially requiring `airflow upgrade db` manually.
fix
Always check the provider's documentation or PyPI page for the exact `apache-airflow` version requirement before upgrading or installing. Upgrade Airflow core if necessary and run `airflow upgrade db`.
affects: All versions, specifically 6.4.0+ requires Airflow 2.11+, 6.2.0+ requires Airflow 2.10+, 5.1.0+ requires Airflow 2.4+, 3.0.0+ requires Airflow 2.2+, 2.1.0+ requires Airflow 2.1+.
gotchaWhen configuring a Trino connection in Airflow, ensure that only one authentication method (e.g., password, JWT, Kerberos) is set in the connection details. Attempting to use multiple authentication methods simultaneously can lead to task failures.
fix
Review your Airflow Trino connection configuration and specify only one authentication method in the 'Extra' field or dedicated fields.
affects: >=6.3.3
breakingIn provider version 5.0.0, the deprecated `delegate_to` parameter was removed from `GCSToTrinoOperator` (and related Google Cloud operators/hooks). Impersonation should now be achieved using the `impersonation_chain` parameter.
fix
Migrate any usage of `delegate_to` in `GCSToTrinoOperator` to `impersonation_chain`. For older versions, consider `impersonation_chain` as best practice.
affects: >=5.0.0
deprecatedThe `apply_default` decorator was removed, which is why older versions of this provider required Airflow 2.1.0+. While fixed, it highlights the need to stay updated with both provider and Airflow core versions.
fix
Ensure your Airflow core version is at least 2.1.0 or higher, as required by the specific provider version you are using.
affects: <2.1.0 of Airflow if using Trino provider versions affected by this change.
Errors
Common errors & fixes
ImportError: cannot import name 'TrinoHook'
This error occurs when attempting to import 'TrinoHook' from an incorrect module path.
fix
Ensure you are importing 'TrinoHook' from the correct module: 'from airflow.providers.trino.hooks.trino import TrinoHook'.
ModuleNotFoundError: No module named 'airflow.providers.trino'
This error occurs when the 'apache-airflow-providers-trino' package is not installed.
fix
Install the package using pip: 'pip install apache-airflow-providers-trino'.
AttributeError: module 'airflow.providers.trino.hooks.trino' has no attribute 'TrinoHook'
This error occurs when the 'TrinoHook' class is not found in the specified module, possibly due to version incompatibility.
fix
Verify that you are using a compatible version of 'apache-airflow-providers-trino' and 'apache-airflow'.
Upgrade
Version history
6.6.1latest on PyPI · released Aug 8, 2026
Audit
Dependencies
apache-airflowrequiredCore Apache Airflow installation is required; version 6.5.1 requires `>=2.11.0`.
trinorequiredPython client for Trino, version `>=0.319.0` required.
pandasrequiredRequired for data handling, specific version depends on Python version (e.g., `>=2.3.3` for Python >= 3.14).
apache-airflow-providers-common-sqlrequiredCommon SQL provider, version `>=1.32.0` required.
apache-airflow-providers-common-compatrequiredCommon compatibility provider, version `>=1.12.0` required.
apache-airflow-providers-googleoptionalEnables integration with Google Cloud services (e.g., for GCSToTrinoOperator). Install with `pip install apache-airflow-providers-trino[google]`.
apache-airflow-providers-openlineageoptionalEnables OpenLineage integration. Install with `pip install apache-airflow-providers-trino[openlineage]`.
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
apache-airflow-providers-trino — pip install apache-airflow-providers-trino · libregistry