Repository: astronomer/astronomer-cosmos (Python)

Issue:
Add Support for the DBT-Exasol Adapter
We should add all of the dbt supported platforms (and then move to the community ones). This will require two things:

- [ ]  default profile that maps to an Airflow connection

- [ ]  new extra in setup.cfg

See Exasol setup in [dbt docs](https://docs.getdbt.com/reference/warehouse-setups/exasol-setup).

See OSS Airflow Docs for [Exasol Provider](https://airflow.apache.org/docs/apache-airflow-providers-exasol/stable/index.html)



Fix (patch):
diff --git a/cosmos/providers/dbt/community/profiles/exasol.py b/cosmos/providers/dbt/community/profiles/exasol.py
new file mode 100644
index 000000000..81ba295be
--- /dev/null
+++ b/cosmos/providers/dbt/community/profiles/exasol.py
@@ -0,0 +1,57 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+    from airflow.models import Connection
+
+exasol_profile = {
+    "outputs": {
+        "dev": {
+            "type": "exasol",
+            "dsn": "{{ env_var('EXASOL_HOST') }}:{{ env_var('EXASOL_PORT') | as_number }}",
+            "user": "{{ env_var('EXASOL_USER') }}",
+            "password": "{{ env_var('EXASOL_PASSWORD') }}",
+            "dbname": "{{ env_var('EXASOL_DATABASE') }}",
+            "schema": "{{ env_var('EXASOL_SCHEMA') }}",
+            "encryption": "{{ env_var('EXASOL_ENCRYPTION') }}",
+            "compression": "{{ env_var('EXASOL_COMPRESSION') }}",
+            "connect_timeout": "{{ env_var('EXASOL_CONNECT_TIMEOUT') }}",
+            "socket_timeout": "{{ env_var('EXASOL_SOCKET_TIMEOUT') }}",
+            "protocol_version": "{{ env_var('EXASOL_PROTOCOL_VERSION') }}",
+        }
+    },
+    "target": "dev",
+}
+
+
+def create_profile_vars_exasol(
+    conn: Connection,
+    database_override: str | None = None,
+    schema_override: str | None = None,
+) -> tuple[str, dict[str, str]]:
+    """
+    https://docs.getdbt.com/reference/warehouse-setups/exasol-setup
+    https://airflow.apache.org/docs/apache-airflow-providers-exasol/stable/index.html
+    """
+
+    if not schema_override:
+        raise ValueError("A exasol schema must be provided via the `schema` parameter")
+
+    extras = conn.extra_dejson
+
+    profile_vars = {
+        "EXASOL_HOST": conn.host,
+        "EXASOL_USER": conn.login,
+        "EXASOL_PASSWORD": conn.password,
+        # airflow uses schema connection field for db - except Snowflake
+        "EXASOL_PORT": str(conn.port),
+        "EXASOL_DATABASE": database_override if database_override else conn.schema,
+        "EXASOL_SCHEMA": schema_override,
+        "EXASOL_ENCRYPTION": extras.get("encryption", "false"),
+        "EXASOL_COMPRESSION": extras.get("compression", "false"),
+        "EXASOL_CONNECTION_TIMEOUT": extras.get("connection_timeout", "30"),
+        "EXASOL_SOCKET_TIMEOUT": extras.get("socket_timeout", "30"),
+        "EXASOL_PROTOCOL_VERSION": extras.get("protocol_version", "V3"),
+    }
+    return "exasol_profile", profile_vars
diff --git a/cosmos/providers/dbt/core/profiles/__init__.py b/cosmos/providers/dbt/core/profiles/__init__.py
index 4f3cf6aa0..497be8740 100644
--- a/cosmos/providers/dbt/core/profiles/__init__.py
+++ b/cosmos/providers/dbt/core/profiles/__init__.py
@@ -1,6 +1,10 @@
 from dataclasses import dataclass
 from typing import TYPE_CHECKING, Callable, Dict, Optional, Tuple
 
+from cosmos.providers.dbt.community.profiles.exasol import (
+    create_profile_vars_exasol,
+    exasol_profile,
+)
 from cosmos.providers.dbt.community.profiles.trino import (
     create_profile_vars_trino,
     trino_profile,
@@ -58,6 +62,9 @@ def get_available_adapters() -> Dict[str, AdapterConfig]:
         "databricks": AdapterConfig(
             "databricks_profile", databricks_profile, create_profile_vars_databricks
         ),
+        "exasol": AdapterConfig(
+            "exasol_profile", exasol_profile, create_profile_vars_exasol
+        ),
         "trino": AdapterConfig(
             "trino_profile", trino_profile, create_profile_vars_trino
         ),
diff --git a/docs/dbt/usage.rst b/docs/dbt/usage.rst
index 278c748b8..6b81e8e06 100644
--- a/docs/dbt/usage.rst
+++ b/docs/dbt/usage.rst
@@ -70,6 +70,7 @@ Cosmos currently supports the following connection types.
 
 * bigquery
 * databricks
+* exasol
 * postgres
 * redshift
 * snowflake
@@ -150,6 +151,14 @@ Builds upon Postgres so the details on schemas are the same.
 
 Cosmos supports the password based authentication `method <https://docs.getdbt.com/reference/warehouse-setups/redshift-setup#password-based-authentication>`__
 
+Exasol
+---------
+
+Builds upon Postgres so the details on schemas are the same.
+
+Cosmos supports the password based authentication `method <https://docs.getdbt.com/reference/warehouse-setups/exasol-setup>`__
+
+
 Snowflake
 ----------
 
diff --git a/pyproject.toml b/pyproject.toml
index ce34ca260..064d31b48 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -47,6 +47,7 @@ dependencies = [
 dbt-all = [
     "dbt-bigquery",
     "dbt-databricks",
+    "dbt-exasol",
     "dbt-postgres",
     "dbt-redshift",
     "dbt-snowflake",
@@ -58,6 +59,9 @@ dbt-bigquery = [
 dbt-databricks = [
     "dbt-databricks",
 ]
+dbt-exasol = [
+    "dbt-exasol",
+]
 dbt-postgres = [
     "dbt-postgres",
 ]