Skip to content

[Feature] Consolidate Database Connection Classes #2151

@astro-anand

Description

@astro-anand

Description

Currently, cosmos profile mappings are not user friendly. For example, Snowflake has 4 different classes for different auth methods. If a user changes their conn to use a different auth method, DAG code needs to be updated

Use case/motivation

To align with Airflow's connection paradigm, I propose consolidating to a single ProfileMapping class per database. The implementation could attempt to import the relevant hook from the provider mocked example below

try:
    from airflow.providers.snowflake.hooks.snowflake import SnowflakeHook
    return SnowflakeHook(snowflake_conn_id=conn_id).get_connection()
except ImportNotFound:
    # factory that returns our custom classes based on the conn details

We could leave the existing classes unchanged, but this allows us to offload auth to the provider packages and play less catchup

Related issues

Example of cosmos team needing to maintain parity with snowflake provider: #1798

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriage-neededItems need to be reviewed / assigned to milestone

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions