> For the complete documentation index, see [llms.txt](https://docs.espresso.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.espresso.ai/snowflake-optimizer/proxy-onboarding/proxy-onboarding-hex-1.md).

# Airflow

### Overview

This guide walks you through updating your Apache Airflow Snowflake connection to point to Espresso's infrastructure. The key change is replacing your Snowflake host (`<your_host>.snowflakecomputing.com`) with the corresponding Espresso host (`<your_host>.espressocomputing.com`).

### Prerequisites

* Access to your Airflow environment (UI or config files)
* Your Espresso account details (host, account name, database, warehouse, etc.)
* The package `apache-airflow-providers-snowflake` must be version >= 6.0.0 for the host parameter to work.

### Steps

#### Option A: Update via the Airflow UI

1. Navigate to **Admin → Connection**s in the Airflow web UI.
2. Find and click on your Snowflake connection (default ID: `snowflake_default`).
3. In the **Extra** field, add or update the `host` parameter to your Espresso endpoint:

{% code overflow="wrap" %}

```json
{
    "account": "<your_account>",
    "database": "<your_database>",
    "warehouse": "<your_warehouse>",
    "host": "<your_host>.espressocomputing.com"
}
```

{% endcode %}

4. Update **Login** and **Password** if your Espresso credentials differ from your previous Snowflake credentials.
5. Click **Save**.

#### Option B: Update via Environment Variable (JSON format)

If you manage connections through environment variables, update the variable as follows:

{% code overflow="wrap" %}

```json
export AIRFLOW_CONN_SNOWFLAKE_DEFAULT='{
    "conn_type": "snowflake",
    "login": "<your_user>",
    "password": "<your_password>",
    "schema": "<your_schema>",
    "extra": {
        "account": "<your_account>",
        "database": "<your_database>",
        "warehouse": "<your_warehouse>",
        "host": "<your_host>.espressocomputing.com"
    }
}'
```

{% endcode %}

#### Option C: Update via Environment Variable (URI format)

If using the URI format (common in Airflow versions prior to 2.3.0):

{% code overflow="wrap" %}

```json
export AIRFLOW_CONN_SNOWFLAKE_DEFAULT='snowflake://<user>:<password>@/<schema>?account=<account>&database=<database>&warehouse=<warehouse>&host=<your_host>.espressocomputing.com'
```

{% endcode %}

**Note:** All URI components should be URL-encoded.

### Verifying the Connection

After updating, test the connection by:

1. Clicking **Test** on the connection page in the Airflow UI (Airflow 2.5+), or
2. Running a simple DAG task that queries Espresso (e.g., a `SnowflakeOperator` with `SELECT 1`).

### Troubleshooting

* **Authentication errors** — Double-check that your Login and Password match your Espresso credentials. If using key pair or OAuth authentication, ensure the relevant Extra fields (`private_key_file`, `authenticator`, etc.) are also updated.
* **Connection timeouts** — Verify that your Airflow environment has network access to `<your_host>.espressocomputing.com`.
* **Schema/database not found** — Confirm that the `database`, `schema`, and `warehouse` values exist in your Espresso account.
