The Apache Airflow Common IO Provider (apache-airflow-providers-common-io, current version 1.7.2) offers a unified interface for interacting with various file systems within Airflow tasks, abstracting away the underlying storage details. It aims to simplify DAG development by providing generic operators and hooks that can work across different storage backends (e.g., local, S3, GCS, Azure Blob Storage), with specific implementations provided by other Airflow provider packages. This provider follows the regular Apache Airflow provider release cadence, receiving updates frequently alongside core Airflow releases.
pip install apache-airflow-providers-common-ioVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `FileSystemHook` from the `common-io` provider to list files in a local directory. While `common-io` aims to abstract different file systems, the `FileSystemHook` (and `FileTransferOperator`) typically rely on Airflow Connection IDs (e.g., `fs_default` for local file systems, `aws_default` for S3) to configure their backend. This example manually sets the `base_path` to a temporary directory for local execution without requiring prior Airflow UI connection setup. In a production DAG, you would typically pass `conn_id` to the hook/operator and configure the connection in Airflow.
Ensure the specific provider package for your target file system (e.g., S3, GCS) is also installed via `pip install apache-airflow-providers-<service>`.
Carefully configure Airflow Connections in the UI or via code. Ensure connection types (e.g., 'fs' for local filesystem, 'aws' for S3) match the intended backend and that connection parameters (e.g., base path, credentials) are correct.
Upgrade your Python environment to 3.10 or newer. Ensure your Airflow environment also supports and is configured for Python >=3.10.
Ensure the 'apache-airflow-providers-common-io' package is installed in your Airflow environment using pip: `pip install apache-airflow-providers-common-io`.