File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ from pydantic import BaseModel
292292class AirflowAccessTokenResponse (BaseModel ):
293293 access_token: str
294294
295+
295296# An optional helper function to retrieve an access token
296297def get_airflow_client_access_token (
297298 host : str ,
@@ -310,6 +311,7 @@ def get_airflow_client_access_token(
310311 response_success = AirflowAccessTokenResponse(** response.json())
311312 return response_success.access_token
312313
314+
313315# Defining the host is optional and defaults to http://localhost
314316# See configuration.py for a list of all supported configuration parameters.
315317host = " http://localhost"
@@ -324,7 +326,7 @@ configuration.access_token = get_airflow_client_access_token(
324326 host = host,
325327 username = " admin-api" ,
326328 password = os.environ[" PASSWORD" ],
327- )
329+ )
328330
329331# Enter a context with an instance of the API client
330332with airflow_client.client.ApiClient(configuration) as api_client:
You can’t perform that action at this time.
0 commit comments