This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 4869c7b Fix MyPy issues in the experimental api (#20713)
4869c7b is described below
commit 4869c7b25eb1e8beb3200d106bb0b8b75b5a0f10
Author: Rajath <[email protected]>
AuthorDate: Thu Jan 6 18:32:32 2022 +0530
Fix MyPy issues in the experimental api (#20713)
Added new sessions as default variable for the method
---
airflow/api/common/experimental/get_lineage.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/airflow/api/common/experimental/get_lineage.py
b/airflow/api/common/experimental/get_lineage.py
index 6db225f..461590b 100644
--- a/airflow/api/common/experimental/get_lineage.py
+++ b/airflow/api/common/experimental/get_lineage.py
@@ -20,14 +20,18 @@ import collections
import datetime
from typing import Any, Dict
+from sqlalchemy.orm import Session
+
from airflow.api.common.experimental import check_and_get_dag,
check_and_get_dagrun
from airflow.lineage import PIPELINE_INLETS, PIPELINE_OUTLETS
from airflow.models.xcom import XCom
-from airflow.utils.session import provide_session
+from airflow.utils.session import NEW_SESSION, provide_session
@provide_session
-def get_lineage(dag_id: str, execution_date: datetime.datetime, *, session) ->
Dict[str, Dict[str, Any]]:
+def get_lineage(
+ dag_id: str, execution_date: datetime.datetime, *, session: Session =
NEW_SESSION
+) -> Dict[str, Dict[str, Any]]:
"""Gets the lineage information for dag specified."""
dag = check_and_get_dag(dag_id)
dagrun = check_and_get_dagrun(dag, execution_date)