airflow.providers.common.compat.check

Functions

require_provider_version(provider_name, ...)

Enforce minimum version requirement for a specific provider.

Module Contents

airflow.providers.common.compat.check.require_provider_version(provider_name, provider_min_version)[source]

Enforce minimum version requirement for a specific provider.

Some providers, do not explicitly require other provider packages but may offer optional features that depend on it. These features are generally available starting from a specific version of such provider. This decorator helps ensure compatibility, preventing import errors and providing clear logs about version requirements.

Args:

provider_name: Name of the provider e.g., apache-airflow-providers-openlineage provider_min_version: Optional minimum version requirement e.g., 1.0.1

Raises:

ValueError: If neither provider_name nor provider_min_version is provided. ValueError: If full provider name (e.g., apache-airflow-providers-openlineage) is not provided. TypeError: If the decorator is used without parentheses (e.g., @require_provider_version).

Was this entry helpful?