2025 年 Airflow 峰会将于 10 月 07-09 日举行。立即注册,获取早鸟票!

包附加功能参考

Airflow 分发包

在 Airflow 3 中,Airflow 现在在已有的 providers 之上被分割成几个独立且隔离的分发包,并且依赖项在这些分发包之间被隔离和简化。

虽然通过 apache-airflow 分发包和附加功能进行的原始安装方法仍然像以前一样工作,并且它会安装完整的 Airflow,可作为调度器、Web 服务器、触发器和工作节点,但现在 apache-airflow 包是一个元包,它会安装所有其他分发包,同时也可以只安装运行 Airflow 特定组件所需的分发包。

提供以下分发包

分发包

用途

可选附加功能

apache-airflow-core

这是核心分发包,包含 Airflow 调度器、Web 服务器、触发器的代码。

  • 核心附加功能,为 Airflow 核心系统添加可选功能 - 增强其在多个 provider 中的功能。

  • all 附加功能,它将所有可选功能一起安装。

apache-airflow-task-sdk

这是在工作节点中运行任务所需的分发包。

  • 没有可选附加功能

apache-airflow-providers-*

这些分发包包含 Airflow 与外部系统、第三方软件和服务的集成。通常它们提供 operators、hooks、sensors、triggers,但也提供不同类型的扩展,如日志处理器、执行器以及其他与特定服务或系统相关的功能。

  • 每个 provider 分发包可能都有自己的可选附加功能。

apache-airflow

这是一个元分发包,它会安装(强制的):

  • apache-airflow-core(总是与 apache-airflow 版本相同)

  • apache-airflow-task-sdk(最新版本)

  • 任何核心附加功能

  • 通过附加功能安装的任何 provider 包

这与 Airflow 2 中的先前安装方法向后兼容。

组附加功能

  • all-core - 安装 apache-airflow-core 包所有附加功能的 extra。

  • all - 安装所有核心附加功能和所有 provider 包(不包含其可选附加功能)的 extra。

如上所述,Airflow 有许多可选的“附加功能(extras)”,您可以在安装 Airflow 时使用它们来为您的安装添加功能。这些附加功能是用户管理其安装的好方法,对于 Airflow 的贡献者来说也很有用,当他们想通过 providers 贡献一些功能(包括 Airflow 的可选集成)时。

以下是 Apache Airflow 的所有额外依赖项列表。

核心 Airflow 附加功能

这些是核心 Airflow 附加功能,用于扩展核心 Airflow 的能力。它们通常不安装 provider 包(除了 celerycncf.kubernetes 附加功能),它们只安装所需包的必要 Python 依赖项。

附加功能 (extra)

安装命令

启用功能

aiobotocore

pip install 'apache-airflow[aiobotocore]'

支持 Amazon 集成的异步(可延迟)operator

async

pip install 'apache-airflow[async]'

Gunicorn 的异步工作节点类

github-enterprise

pip install 'apache-airflow[github-enterprise]'

GitHub Enterprise 认证后端

google-auth

pip install 'apache-airflow[google-auth]'

Google 认证后端

graphviz

pip install 'apache-airflow[graphviz]'

用于将 DAG 转换为图形输出的 Graphviz 渲染器

kerberos

pip install 'apache-airflow[kerberos]'

Kerberos 集成,用于支持 Kerberos 的服务(Hadoop, Presto, Trino)

ldap

pip install 'apache-airflow[ldap]'

用于用户 LDAP 认证

leveldb

pip install 'apache-airflow[leveldb]'

Google provider 中使用 leveldb extra 所需

otel

pip install 'apache-airflow[otel]'

OpenTelemetry 指标所需

pandas

pip install 'apache-airflow[pandas]'

安装与 Airflow 兼容的 Pandas 库

rabbitmq

pip install 'apache-airflow[rabbitmq]'

支持 RabbitMQ 作为 Celery 后端

sentry

pip install 'apache-airflow[sentry]'

用于应用程序日志和监控的 Sentry 服务

s3fs

pip install 'apache-airflow[s3fs]'

支持 S3 作为 Airflow 文件系统

saml

pip install 'apache-airflow[saml]'

支持 Airflow 中的 SAML 认证

standard

pip install apache-airflow[standard]'

标准 hooks 和 operators

statsd

pip install 'apache-airflow[statsd]'

StatsD 指标所需

uv

pip install 'apache-airflow[uv]'

安装 uv - 基于 Rust 的快速包安装器(实验性)

cloudpickle

pip install apache-airflow[cloudpickle]

Cloudpickle hooks 和 operators

Provider 附加功能

这些 provider 附加功能只是方便安装 provider 的额外项,这样您就可以通过简单命令安装 provider - 包括 provider 包和必要的依赖项,都在一个命令中完成,这让 PIP 能够解决任何冲突的依赖项。

这对于首次安装非常有用,您希望重复地安装对 Airflow 和已安装 providers 都“有效”的依赖项版本。

  • apache-airflow

  • apache-airflow-core

  • apache-airflow-task-sdk

  • 例如,以下命令将安装

  • apache-airflow-providers-amazon

  • apache-airflow-providers-google

apache-airflow-providers-apache-spark

pip install apache-airflow[google,amazon,apache-spark]==3.0.0 \
  --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.0.0/constraints-3.9.txt"

基于 Airflow 社区在 3.0.0 版本发布时提供的约束文件,安装一组一致的依赖项。

注意,这将安装 Airflow 3.0.0 发布时发布的 provider 版本。如果您想使用最新版本的 provider,可以稍后手动升级这些 provider。

此外,这些附加功能仅在 apache-airflow 分发包中可用,因为它们是方便地将所有 airflow 包一起安装的方式 - 类似于 Airflow 2 中发生的情况。当您单独安装 airflow-coreairflow-task-sdk 时,如果您想安装 provider,需要将它们作为 apache-airflow-providers-* 分发包单独安装。

Apache 软件附加功能

附加功能 (extra)

安装命令

启用功能

这些是为与其他 Apache 项目集成而添加所需依赖项的附加功能(注意 apache.atlasapache.webhdfs 没有自己的 provider - 它们只安装可在自定义 bash/python provider 中使用的附加库)。

apache-atlas

pip install 'apache-airflow[apache-atlas]'

Apache Atlas

apache-beam

pip install 'apache-airflow[apache-beam]'

Apache Beam operators 和 hooks

apache-cassandra

pip install 'apache-airflow[apache-cassandra]'

与 Cassandra 相关的 operators 和 hooks

apache-drill

pip install 'apache-airflow[apache-drill]'

与 Drill 相关的 operators 和 hooks

apache-druid

pip install 'apache-airflow[apache-druid]'

与 Druid 相关的 operators 和 hooks

apache-flink

pip install 'apache-airflow[apache-flink]'

与 Flink 相关的 operators 和 hooks

apache-hdfs

pip install 'apache-airflow[apache-hdfs]'

HDFS hooks 和 operators

apache-hive

pip install 'apache-airflow[apache-hive]'

所有与 Hive 相关的 operators

apache-iceberg

pip install 'apache-airflow[apache-iceberg]'

Apache Iceberg hooks

apache-impala

pip install 'apache-airflow[apache-impala]'

所有与 Impala 相关的 operators 和 hooks

apache-kafka

pip install 'apache-airflow[apache-kafka]'

所有与 Kafka 相关的 operators 和 hooks

apache-kylin

pip install 'apache-airflow[apache-kylin]'

所有与 Kylin 相关的 operators 和 hooks

apache-livy

pip install 'apache-airflow[apache-livy]'

所有与 Livy 相关的 operators、hooks 和 sensors

apache-pig

pip install 'apache-airflow[apache-pig]'

所有与 Pig 相关的 operators 和 hooks

apache-pinot

pip install 'apache-airflow[apache-pinot]'

所有与 Pinot 相关的 hooks

apache-spark

pip install 'apache-airflow[apache-spark]'

所有与 Spark 相关的 operators 和 hooks

apache-webhdfs

pip install 'apache-airflow[apache-hdfs]'

外部服务附加功能

这些是为与外部服务(基于云或本地)集成而添加所需依赖项的附加功能。

附加功能 (extra)

安装命令

启用功能

airbyte

pip install 'apache-airflow[airbyte]'

Airbyte hooks 和 operators

alibaba

pip install 'apache-airflow[alibaba]'

阿里云

apprise

pip install 'apache-airflow[apprise]'

Apprise 通知

amazon

pip install 'apache-airflow[amazon]'

亚马逊 Web Services

asana

pip install 'apache-airflow[asana]'

Asana hooks 和 operators

atlassian-jira

pip install 'apache-airflow[atlassian-jira]'

Jira hooks 和 operators

microsoft-azure

pip install 'apache-airflow[microsoft-azure]'

Microsoft Azure

cloudant

pip install 'apache-airflow[cloudant]'

Cloudant hook

cohere

pip install 'apache-airflow[cohere]'

Cohere hook 和 operators

databricks

pip install 'apache-airflow[databricks]'

Databricks hooks 和 operators

datadog

pip install 'apache-airflow[datadog]'

Datadog hooks 和 sensors

dbt-cloud

pip install 'apache-airflow[dbt-cloud]'

dbt Cloud hooks 和 operators

dingding

pip install 'apache-airflow[dingding]'

钉钉 hooks 和 sensors

discord

pip install 'apache-airflow[discord]'

Discord hooks 和 sensors

facebook

pip install 'apache-airflow[facebook]'

Facebook 社交

github

pip install 'apache-airflow[github]'

GitHub operators 和 hook

google

pip install 'apache-airflow[google]'

Google Cloud

hashicorp

pip install 'apache-airflow[hashicorp]'

Hashicorp 服务 (Vault)

openai

pip install 'apache-airflow[openai]'

Open AI hooks 和 operators

opsgenie

pip install 'apache-airflow[opsgenie]'

OpsGenie hooks 和 operators

pagerduty

pip install 'apache-airflow[pagerduty]'

Pagerduty hook

pgvector

pip install 'apache-airflow[pgvector]'

pgvector operators 和 hook

pinecone

pip install 'apache-airflow[pinecone]'

Pinecone Operators 和 Hooks

qdrant

pip install 'apache-airflow[qdrant]'

Qdrant Operators 和 Hooks

salesforce

pip install 'apache-airflow[salesforce]'

Salesforce hook

sendgrid

pip install 'apache-airflow[sendgrid]'

使用 sendgrid 发送电子邮件

segment

pip install 'apache-airflow[segment]'

Segment hooks 和 sensors

slack

pip install 'apache-airflow[slack]'

Slack hooks 和 operators

snowflake

pip install 'apache-airflow[snowflake]'

Snowflake hooks 和 operators

tableau

pip install 'apache-airflow[tableau]'

Tableau hooks 和 operators

tabular

pip install 'apache-airflow[tabular]'

Tabular hooks

telegram

pip install 'apache-airflow[telegram]'

Telegram hooks 和 operators

vertica

pip install 'apache-airflow[vertica]'

支持 Vertica hook 作为 Airflow 后端

weaviate

pip install 'apache-airflow[weaviate]'

Weaviate hook 和 operators

yandex

pip install 'apache-airflow[yandex]'

Yandex.cloud hooks 和 operators

ydb

pip install 'apache-airflow[ydb]'

YDB hooks 和 operators

zendesk

pip install 'apache-airflow[zendesk]'

Zendesk hooks

本地安装软件附加功能

这些是为与通常作为 Airflow 部署一部分安装的其他软件包集成而添加所需依赖项的附加功能。其中一些使 Airflow 能够使用执行器来运行任务 - 而不是通过内置的 LocalExecutor。

附加功能 (extra)

安装命令

提供

启用执行器

arangodb

pip install 'apache-airflow[arangodb]'

ArangoDB operators, sensors 和 hook

celery

pip install 'apache-airflow[celery]'

Celery 依赖项和 sensor

CeleryExecutor, CeleryKubernetesExecutor

cncf-kubernetes

pip install 'apache-airflow[cncf-kubernetes]'

Kubernetes 客户端库, KubernetesPodOperator 及相关项

KubernetesExecutor, LocalKubernetesExecutor

docker

pip install 'apache-airflow[docker]'

Docker hooks 和 operators

edge3

pip install 'apache-airflow[edge3]'

通过 HTTP 将 Edge Workers 连接到调度器

EdgeExecutor

elasticsearch

pip install 'apache-airflow[elasticsearch]'

Elasticsearch hooks 和日志处理器

exasol

pip install 'apache-airflow[exasol]'

Exasol hooks 和 operators

fab

pip install 'apache-airflow[fab]'

FAB 认证管理器

git

pip install 'apache-airflow[git]'

Git bundle 和 hook

github

pip install 'apache-airflow[github]'

GitHub operators 和 hook

influxdb

pip install 'apache-airflow[influxdb]'

Influxdb operators 和 hook

jenkins

pip install 'apache-airflow[jenkins]'

Jenkins hooks 和 operators

mongo

pip install 'apache-airflow[mongo]'

Mongo hooks 和 operators

microsoft-mssql

pip install 'apache-airflow[microsoft-mssql]'

Microsoft SQL Server operators 和 hook。

mysql

pip install 'apache-airflow[mysql]'

MySQL operators 和 hook

neo4j

pip install 'apache-airflow[neo4j]'

Neo4j operators 和 hook

odbc

pip install 'apache-airflow[odbc]'

ODBC 数据源,包括 MS SQL Server。

openfaas

pip install 'apache-airflow[openfaas]'

OpenFaaS hooks

oracle

pip install 'apache-airflow[oracle]'

Oracle hooks 和 operators

postgres

pip install 'apache-airflow[postgres]'

PostgreSQL operators 和 hook

presto

pip install 'apache-airflow[presto]'

所有与 Presto 相关的 operators 和 hooks

redis

pip install 'apache-airflow[redis]'

Redis hooks 和 sensors

samba

pip install 'apache-airflow[samba]'

Samba hooks 和 operators

singularity

pip install 'apache-airflow[singularity]'

Singularity 容器 operator

teradata

pip install 'apache-airflow[teradata]'

Teradata hooks 和 operators

trino

pip install 'apache-airflow[trino]'

所有与 Trino 相关的 operators 和 hooks

其他附加功能

这些是提供支持以便通过一些(通常是)标准协议与外部系统集成的附加功能。

预安装 列中带有 * 标记的条目表示这些附加功能(provider)在安装 Airflow 时总是预安装的。

附加功能 (extra)

安装命令

启用功能

预安装

common-compat

pip install 'apache-airflow[common-compat]'

旧版本 Airflow 的兼容性代码

common-io

pip install 'apache-airflow[common-io]'

核心 IO operators

common-messaging

pip install 'apache-airflow[common-messaging]'

核心消息 operators

common-sql

pip install 'apache-airflow[common-sql]'

核心 SQL operators

ftp

pip install 'apache-airflow[ftp]'

FTP hooks 和 operators

grpc

pip install 'apache-airflow[grpc]'

Grpc hooks 和 operators

http

pip install 'apache-airflow[http]'

HTTP hooks, operators 和 sensors

imap

pip install 'apache-airflow[imap]'

IMAP hooks 和 sensors

jdbc

pip install 'apache-airflow[jdbc]'

JDBC hooks 和 operators

microsoft-psrp

pip install 'apache-airflow[microsoft-psrp]'

PSRP hooks 和 operators

microsoft-winrm

pip install 'apache-airflow[microsoft-winrm]'

WinRM hooks 和 operators

openlineage

pip install 'apache-airflow[openlineage]'

发送 OpenLineage 事件

opensearch

pip install 'apache-airflow[opensearch]'

Opensearch hooks 和 operators

papermill

pip install 'apache-airflow[papermill]'

Papermill hooks 和 operators

sftp

pip install 'apache-airflow[sftp]'

SFTP hooks, operators 和 sensors

smtp

pip install 'apache-airflow[smtp]'

SMTP hooks 和 operators

sqlite

pip install 'apache-airflow[sqlite]'

SQLite hooks 和 operators

ssh

pip install 'apache-airflow[ssh]'

SSH hooks 和 operators

组附加功能

组附加功能是方便的附加功能。这种附加功能会一起安装许多可选依赖项。不建议在生产环境中使用,但对于 CI、开发和测试很有用。

附加功能 (extra)

安装命令

启用功能

all

pip install apache-airflow[all]

所有可选依赖项,包括所有 providers

all-core

pip install apache-airflow[all-core]

所有可选核心依赖项

这篇文档有帮助吗?