Registry / aws / apache-airflow-providers-common-io

apache-airflow-providers-common-io

JSON →
library1.8.0pypypi✓ verified 24d ago

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-io
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-common-io
awspythonv1.8.0
Install
24.2s avg
Import
Disk
256MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.8.0 · 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
installs and imports cleanly · install 0.0s · import 0.000s · 256.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 24.2s · import 0.000s · 255MB
256MB installed
● package 256MB
Code
Verified usage

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

FileSystemHook
from airflow.providers.common.io.hooks.filesystem import FileSystemHook
from airflow.providers.common.io.hooks.filesystem import FileSystemHook

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.

from __future__ import annotations import os import tempfile from pathlib import Path import pendulum from airflow.models.dag import DAG from airflow.operators.python import PythonOperator from airflow.providers.common.io.hooks.filesystem import FileSystemHook def _demonstrate_common_io_hook(): # Create a temporary local directory and files to demonstrate listing with tempfile.TemporaryDirectory() as tmpdir: test_dir_path = Path(tmpdir) / "common_io_test_data" test_dir_path.mkdir(exist_ok=True) (test_dir_path / "file_a.txt").write_text("Content A") (test_dir_path / "file_b.txt").write_text("Content B") print(f"Created dummy files in: {test_dir_path}") # Instantiate FileSystemHook. # In a real Airflow setup, this hook would typically resolve an Airflow Connection ID # (e.g., `conn_id='fs_default'`) to determine the base path and other config. # For this quickstart, we explicitly set the base_path to our temporary directory # to make it runnable without prior Airflow UI connection setup. hook = FileSystemHook() hook.base_path = str(test_dir_path) print(f"Listing files in base_path: {hook.base_path}") # List files using the common IO interface listed_items = list(hook.list_path()) # list_path returns a generator of BasePath objects if listed_items: print("Files found:") for item in listed_items: print(f"- {item.path_str}") else: print("No files found.") with DAG( dag_id="common_io_quickstart", start_date=pendulum.datetime(2023, 10, 26, tz="UTC"), catchup=False, schedule=None, tags=["common_io", "example", "quickstart"], ) as dag: list_files_task = PythonOperator( task_id="list_files_with_common_io", python_callable=_demonstrate_common_io_hook, )
Debug
Known issues
gotchaThe `common-io` provider offers a generic interface, but it does NOT provide the concrete implementations for specific cloud storage services (e.g., S3, GCS, Azure Blob Storage). To use `common-io` hooks or operators with these services, you must also install the respective cloud provider packages (e.g., `apache-airflow-providers-s3`, `apache-airflow-providers-google`). Without them, `common-io` will not be able to interact with those backends.
fix
Ensure the specific provider package for your target file system (e.g., S3, GCS) is also installed via `pip install apache-airflow-providers-<service>`.
affects: All versions
gotchaOperators like `FileTransferOperator` and hooks like `FileSystemHook` heavily rely on Airflow Connection IDs (e.g., `source_filesystem_conn_id`, `destination_filesystem_conn_id`). Misconfigured connections, incorrect connection types, or missing connections will lead to runtime errors when the task attempts to interact with the file system.
fix
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.
affects: All versions
gotchaThe `apache-airflow-providers-common-io` package requires Python >=3.10. Users running Airflow on older Python versions will encounter installation or runtime errors due to this dependency.
fix
Upgrade your Python environment to 3.10 or newer. Ensure your Airflow environment also supports and is configured for Python >=3.10.
affects: 1.7.0 and later
breakingThe `apache-airflow-providers-common-io` package, which provides core common-io hooks and operators, must be explicitly installed in your Airflow environment. If it is not installed, import errors such as `ModuleNotFoundError` will occur when attempting to use its components.
fix
Ensure the 'apache-airflow-providers-common-io' package is installed in your Airflow environment using pip: `pip install apache-airflow-providers-common-io`.
affects: All versions
Upgrade
Version history
1.8.0latest on PyPI · released Jul 4, 2026
Audit
Dependencies
apache-airflowrequiredThis is an Airflow provider and requires Apache Airflow to run. Specific cloud storage functionality (e.g., S3, GCS) will require their respective provider packages (e.g., apache-airflow-providers-s3, apache-airflow-providers-google) to be installed in addition to common-io.
Agent activity
54 hits · last 30 days
node
45
OpenAI (training)
1
Resources
apache-airflow-providers-common-io — pip install apache-airflow-providers-common-io · libregistry