Implementation:Astronomer Astronomer cosmos OracleUserPasswordProfileMapping
| Knowledge Sources | |
|---|---|
| Domains | Profile_Mapping, Oracle |
| Last Updated | 2026-02-07 17:00 GMT |
Overview
Concrete tool for mapping Airflow oracle connections to dbt oracle profiles provided by astronomer-cosmos.
Description
The OracleUserPasswordProfileMapping maps an Airflow oracle connection to a dbt oracle profile. It translates connection parameters (host, login, password, schema, port, extras) into the YAML structure that dbt expects in `profiles.yml`. This is a community-contributed adapter (`is_community=True`). It maps host, port, user, password, schema, database, and service name from the Airflow Oracle connection fields. It also supports optional parameters such as shardingkey and supershardingkey from the connection extras.
Usage
Use this profile mapping when configuring Cosmos to run dbt commands against an Oracle backend. Assign it to `ProfileConfig(profile_mapping=...)` when the target Airflow connection uses the `oracle` connection type.
Code Reference
Source Location
- Repository: Astronomer_Astronomer_cosmos
- File: cosmos/profiles/oracle/user_pass.py
Signature
class OracleUserPasswordProfileMapping(BaseProfileMapping):
airflow_connection_type: str = "oracle"
dbt_profile_type: str = "oracle"
is_community: bool = True
Import
from cosmos.profiles.oracle import OracleUserPasswordProfileMapping
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| conn_id | str | Yes | Airflow connection ID for Oracle |
Outputs
| Name | Type | Description |
|---|---|---|
| profile | dict | dbt profile YAML dictionary |
| env_vars | dict | Environment variables for secret fields |
Usage Examples
from cosmos.config import ProfileConfig
from cosmos.profiles.oracle import OracleUserPasswordProfileMapping
profile_config = ProfileConfig(
profile_name="default",
target_name="dev",
profile_mapping=OracleUserPasswordProfileMapping(conn_id="oracle_default"),
)