uranusjr commented on code in PR #31128:
URL: https://github.com/apache/airflow/pull/31128#discussion_r1188031677
##########
airflow/lineage/__init__.py:
##########
@@ -133,13 +134,16 @@ def wrapper(self, context, *args, **kwargs):
# Remove auto and task_ids
self.inlets = [i for i in self.inlets if not isinstance(i, str)]
- _inlets = self.xcom_pull(context, task_ids=task_ids,
dag_id=self.dag_id, key=PIPELINE_OUTLETS)
+ with create_session() as session:
+ _inlets = self.xcom_pull(
+ context, task_ids=task_ids, dag_id=self.dag_id,
key=PIPELINE_OUTLETS, session=session
+ )
Review Comment:
Would be a good idea to add a comment explaining why this additional session
creation is needed, and why it eliminates the issue (the dangling session in
`LazyXComAccess`). It would also be a good idea to explain why the next two
lines need to be indented into the context manager as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]