GitHub user brki created a discussion: Is it possible to use a Connection 
stored in the metadata DB from a python shell

Sometimes when I want to investigate something, it's easiest to it in an 
interactive shell.

In Airflow 2, I could fire up a python shell and run something like:

```
from airflow.providers.mysql.hooks.mysql import MySqlHook
hook = MySqlHook(mysql_conn_id="my_conn_id")
engine = hook.get_sqlalchemy_engine()
...
```

But with Airflow 3, I get: `airflow.exceptions.AirflowNotFoundException: The 
conn_id my_conn_id isn't defined`

`my_conn_id` is a Connection defined and stored in my Airflow metadata DB.

Is there a way to make this work with Airflow 3?

GitHub link: https://github.com/apache/airflow/discussions/60334

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to