apache/airflow-client-python

User confirmation needed

rizh42 opened this issue · 2 comments

I try to connect to remote airflow server
While using client I get ApiTypeError because instead of one of the arguments, the html code goes to the function, where there is User confirmation needed string
Here is my code:

import os.path
from dotenv import load_dotenv
import airflow_client.client
from airflow_client.client.api import dag_api


dotenv_path = os.path.join(os.path.dirname(__file__), 'conn_info.env')
if os.path.exists(dotenv_path):
    load_dotenv(dotenv_path)

AIRFLOW_CONN_INFO = {
    'host': os.getenv('AIRFLOW_HOST'),
    'username': os.getenv('airflow_login'),
    'password': os.getenv('airflow_password')
}

config = airflow_client.client.Configuration(
    host=AIRFLOW_CONN_INFO['host'],
    username=AIRFLOW_CONN_INFO['username'],
    password=AIRFLOW_CONN_INFO['password']
)

with airflow_client.client.ApiClient(config) as api_client:
    api_instance = dag_api.DAGApi(api_client)
    api_response = api_instance.get_dags()
    print(api_response)

Help please

ashb commented

What is the exact error you're getting?

closing as stale