Junnplus commented on a change in pull request #13929:
URL: https://github.com/apache/airflow/pull/13929#discussion_r570916639
##########
File path: airflow/sentry.py
##########
@@ -150,13 +150,21 @@ def add_breadcrumbs(self, task_instance, session=None):
def enrich_errors(self, func):
"""Wrap TaskInstance._run_raw_task to support task specific tags
and breadcrumbs."""
+ session_args_idx = find_session_idx(func)
+
@wraps(func)
- def wrapper(task_instance, *args, session=None, **kwargs):
+ def wrapper(task_instance, *args, **kwargs):
# Wrapping the _run_raw_task function with push_scope to
contain
# tags and breadcrumbs to a specific Task Instance
+
+ try:
+ session = kwargs.get('session', args[session_args_idx])
+ except IndexError:
+ session = None
Review comment:
This behavior remains the same as before.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]