package extras 參考文檔

Airflow 有許多可選的「extras」,您可以在安裝 Airflow 時使用它們來新增功能到您的安裝中。這些 extras 是使用者管理其安裝的好方法,但對於 airflow 的貢獻者來說也很有用,當他們想要貢獻某些功能時 - 包括 Airflow 的可選整合 - 透過 providers。

警告

傳統上,在 Airflow 中,某些 extras 使用 ._ 來分隔 extra 名稱的各個部分。這不是 PEP-685 標準化的名稱,我們選擇將其更改為 - 以用於我們所有的 extras,期望 PEP-685 將被 pip 和其他工具完全實施,我們將所有 extras 更改為使用 - 作為分隔符,即使在某些情況下會引入警告(這些警告是無害的)。這是一種面向未來的方法。如果您在 extras 中使用 _.,它也完全向後兼容,但我們建議將 - 作為未來的分隔符。

以下是 Apache Airflow 的所有額外依賴項列表。

核心 Airflow 額外套件

這些是核心 airflow 額外套件,擴展了核心 Airflow 的功能。它們通常不安裝 provider 套件(除了 celerycncf.kubernetes 額外套件),它們僅安裝所提供套件所需的 python 依賴項。

extra

安裝命令

啟用

aiobotocore

pip install 'apache-airflow[aiobotocore]'

支援 Amazon 整合的非同步(可延遲) Operators

async

pip install 'apache-airflow[async]'

適用於 Gunicorn 的非同步 worker 類別

cgroups

pip install 'apache-airflow[cgroups]'

使用 CgroupTaskRunner 所需

deprecated-api

pip install 'apache-airflow[deprecated-api]'

已棄用、實驗性 API,已被新的 REST API 取代

github-enterprise

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

GitHub 企業版驗證後端

google-auth

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

Google 驗證後端

graphviz

pip install 'apache-airflow[graphviz]'

Graphviz 渲染器,用於將 DAG 轉換為圖形輸出

kerberos

pip install 'apache-airflow[kerberos]'

Kerberos 整合,適用於 Kerberized 服務(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 函式庫

password

pip install 'apache-airflow[password]'

使用者密碼驗證

pydantic

pip install 'apache-airflow[pydantic]'

用於 internal-api 的 Pydantic 序列化

rabbitmq

pip install 'apache-airflow[rabbitmq]'

RabbitMQ 支援作為 Celery 後端

sentry

pip install 'apache-airflow[sentry]'

Sentry 服務,用於應用程式日誌記錄和監控

s3fs

pip install 'apache-airflow[s3fs]'

支援 S3 作為 Airflow FS

saml

pip install 'apache-airflow[saml]'

Airflow 中 SAML 驗證的支援

statsd

pip install 'apache-airflow[statsd]'

StatsD 指標所需

uv

pip install 'apache-airflow[uv]'

安裝 uv - 快速、基於 Rust 的套件安裝程式(實驗性)

virtualenv

pip install 'apache-airflow[virtualenv]'

在本機 virtualenv 中執行 python 任務

cloudpickle

pip install apache-airflow[cloudpickle]

Cloudpickle hooks 和 operators

提供者額外套件

這些提供者額外套件只是為了方便安裝 provider 套件,以便您可以使用簡單的命令安裝 providers - 包括 provider 套件和必要的依賴項在單個命令中,這允許 PIP 解析任何衝突的依賴項。這對於首次安裝非常有用,在首次安裝中,您希望重複安裝對於 airflow 和已安裝的 providers 都是「有效」的依賴項版本。

例如,以下命令將安裝

  • apache-airflow

  • apache-airflow-providers-amazon

  • apache-airflow-providers-google

  • apache-airflow-providers-apache-spark

使用基於 Airflow 社群在 2.10.4 版本發佈時提供的約束檔案的一致依賴項集。

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

請注意,這將安裝在 Airflow 2.10.4 版本發佈時發佈的 provider 版本。如果您想使用最新版本的 providers,您可以稍後手動升級這些 providers。

Apache 軟體額外套件

這些 extras 添加了與其他 Apache 專案整合所需的依賴項(請注意,apache.atlasapache.webhdfs 沒有自己的 providers - 它們僅安裝可以在自訂 bash/python providers 中使用的其他函式庫)。

extra

安裝命令

啟用

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-webhdfs]'

HDFS hooks 和 operators

外部服務額外套件

這些 extras 添加了與外部服務整合所需的依賴項 - 無論是基於雲端還是內部部署。

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]'

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]'

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

本地安裝軟體額外套件

這些 extras 添加了與其他軟體套件整合所需的依賴項,這些軟體套件通常作為 Airflow 部署的一部分安裝。其中一些使 Airflow 能夠使用 executors 來執行任務 - 而不是透過內建的 LocalExecutor。

extra

安裝命令

帶來

啟用 executors

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 client 函式庫、KubernetesPodOperator & friends

KubernetesExecutor, LocalKubernetesExecutor

docker

pip install 'apache-airflow[docker]'

Docker hooks 和 operators

elasticsearch

pip install 'apache-airflow[elasticsearch]'

Elasticsearch hooks 和 Log Handler

exasol

pip install 'apache-airflow[exasol]'

Exasol hooks 和 operators

fab

pip install 'apache-airflow[fab]'

FAB 身份驗證管理器

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

其他額外套件

這些 extras 提供透過某些 - 通常是 - 標準協定與外部系統整合的支援。

Preinstalled 欄位中帶有 * 的條目表示,當安裝 Airflow 時,這些 extras(providers)始終是預先安裝的。

extra

安裝命令

啟用

預裝

common-compat

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

舊版 Airflow 的相容性程式碼

common-io

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

核心 IO 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

生產套件組合額外套件

這些 extras 將一個或多個 extras 作為一個套件組合安裝。

extra

安裝命令

啟用

all

pip install 'apache-airflow[all]'

所有 Airflow 使用者面向的功能(沒有 devel 和 doc 需求)

all-core

pip install 'apache-airflow[all-core]'

不需要安裝 providers 的所有核心 airflow 功能

all-dbs

pip install 'apache-airflow[all-dbs]'

所有資料庫整合

開發額外套件

devel extras 僅在可編輯模式下才有意義。Airflow 的使用者不應使用它們,除非他們開始回饋貢獻並從來源安裝 airflow。這些 extras 僅在從來源以可編輯模式安裝 Airflow 時可用 (pip install -e .[devel,EXTRAS])。

Devel 額外套件

devel extras 不安裝 Airflow 功能的依賴項,而是新增開發 Airflow 所需的功能,例如執行測試、靜態檢查。

extra

安裝命令

啟用

devel-debuggers

pip install -e ‘.[devel-debuggers]’

新增測試 debuggers 所需的所有測試函式庫

devel-devscripts

pip install -e ‘.[devel-devscripts]’

新增測試 devel scripts 所需的所有測試函式庫

devel-duckdb

pip install -e ‘.[devel-duckdb]’

新增測試 duckdb 所需的所有測試函式庫

devel-iceberg

pip install -e ‘.[devel-iceberg]’

新增測試 iceberg 所需的所有測試函式庫

devel-mypy

pip install -e ‘.[devel-mypy]’

新增測試 mypy 所需的所有測試函式庫

devel-sentry

pip install -e ‘.[devel-sentry]’

新增測試 sentry 所需的所有測試函式庫

devel-static-checks

pip install -e ‘.[devel-static-checks]’

新增測試 static_checks 所需的所有測試函式庫

devel-tests

pip install -e ‘.[devel-tests]’

新增測試 tests 所需的所有測試函式庫

Bundle devel 額外套件

這些 extras 將 devel、editable 和 doc extras 捆綁在一起,以便於在單個安裝中一起安裝它們。某些 extras 在某些系統(例如 ARM MacBooks)上更難安裝,因為它們需要安裝系統級別的依賴項。

請注意,pip install -e ".[devel]" 應該至少運行一次,第一次初始化可編輯環境時,以便獲得最小、完整的測試環境,其中包含用於單元測試的常用工具和依賴項。

extra

安裝命令

啟用

devel

pip install -e '.[devel]'

最小開發依賴項 - 最小、完整的測試環境

devel-hadoop

pip install -e '.[devel-hadoop]'

新增 Hadoop stack 函式庫 devel 依賴項

devel-all-dbs

pip install -e '.[devel-all-dbs]'

新增測試資料庫 providers 所需的所有函式庫

devel-all

pip install -e '.[devel-all]'

開發所需的一切,包括 Hadoop、所有 devel extras、所有 doc extras。一般來說:除了 providers 之外的所有可能的依賴項

devel-ci

pip install -e '.[devel-ci]'

CI 測試所需的所有依賴項(與 devel-all 相同)

Doc 額外套件

這些是為 Airflow 產生文件所需的 extras。這僅用於開發時

extra

安裝命令

啟用

doc

pip install -e '.[doc]'

建構文件所需的套件(包含在 devel 中)

doc-gen

pip install -e '.[doc-gen]'

產生 er 圖所需的套件(包含在 devel-all 中)

已棄用的 1.10 額外套件

這些是在 2.0 中已棄用並將在 Airflow 3.0.0 中移除的 extras。它們都已被新的 extras 取代,這些 extras 的命名與 provider 套件的名稱一致。

crypto extra 已不再需要,因為所有 crypto 依賴項都是 airflow 套件的一部分,因此 crypto extra 沒有替代品。

已棄用的 extra

要改為使用的 Extra

atlas

apache-atlas

aws

amazon

azure

microsoft-azure

cassandra

apache-cassandra

crypto

druid

apache-druid

gcp

google

gcp-api

google

hdfs

apache-hdfs

hive

apache-hive

kubernetes

cncf-kubernetes

mssql

microsoft-mssql

pinot

apache-pinot

s3

amazon

spark

apache-spark

webhdfs

apache-webhdfs

winrm

microsoft-winrm

此條目是否有幫助?