Implementation:Astronomer Astronomer cosmos Provider Info
| Knowledge Sources | |
|---|---|
| Domains | Provider, Registration |
| Last Updated | 2026-02-07 17:00 GMT |
Overview
The Provider_Info module exposes the get_provider_info function that returns Airflow provider metadata for the astronomer-cosmos package.
Description
This module contains a single function, get_provider_info, which returns a dictionary conforming to the Airflow provider info specification. The returned metadata enables Airflow to recognize astronomer-cosmos as a first-class provider package and includes:
- package-name:
"astronomer-cosmos"-- the PyPI package identifier. - name:
"Astronomer Cosmos"-- the human-readable display name. - description: A description stating that Cosmos is a library for rendering dbt workflows in Airflow, containing DAGs, task groups, and operators.
- versions: A list containing the current Cosmos version, dynamically read from
cosmos.__version__. - config: A nested dictionary defining the
[cosmos]configuration section for Airflow, which currently includes thepropagate_logsoption (a boolean, added in 1.3.0a1, deprecated in 1.6.0a1 because the underlying logging issue was resolved with a new approach).
This function is registered as an entry point in the package metadata: apache_airflow_provider = cosmos.provider_info:get_provider_info. Airflow discovers and invokes it automatically during provider registration.
Usage
This function is consumed by the Airflow provider discovery mechanism and should not typically be called directly by users. It is primarily relevant for package maintainers and for understanding how Cosmos integrates with Airflow's provider ecosystem.
Code Reference
Source Location
- Repository: Astronomer_Astronomer_cosmos
- File: cosmos/provider_info.py
Signature
def get_provider_info() -> dict[str, Any]:
...
Import
from cosmos.provider_info import get_provider_info
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | -- | -- | This function takes no arguments |
Outputs
| Name | Type | Description |
|---|---|---|
| return value | dict[str, Any] |
A dictionary containing provider metadata with keys: package-name, name, description, versions, and config
|
Return Value Structure
| Key | Type | Description |
|---|---|---|
| package-name | str |
The PyPI package name: "astronomer-cosmos"
|
| name | str |
Human-readable name: "Astronomer Cosmos"
|
| description | str |
Package description string |
| versions | list[str] |
List containing the current Cosmos version |
| config | dict |
Airflow configuration section definitions (the [cosmos] section with its options)
|
Usage Examples
from cosmos.provider_info import get_provider_info
# Retrieve the provider metadata dictionary
info = get_provider_info()
print(info["package-name"]) # "astronomer-cosmos"
print(info["name"]) # "Astronomer Cosmos"
print(info["versions"]) # e.g., ["1.8.0"]
# Inspect available configuration options
cosmos_config = info["config"]["cosmos"]["options"]
for option_name, option_details in cosmos_config.items():
print(f"{option_name}: {option_details['description']}")