Skip to content

Commit

Permalink
Remove superfluous @Sentry.enrich_errors (#37002)
Browse files Browse the repository at this point in the history
* Remove superfluous `@Sentry.enrich_errors` from `TaskInstance._schedule_downstream_tasks`

A recent refactoring broke the contract `enrich_errors` expect. This decorator
is being removed because it's not desired to log Sentry errors for scheduling issues.

* Fix incorrect parameter name

Resolves MyPy error

(cherry picked from commit 45b6b7a)
  • Loading branch information
jkramer-ginkgo authored and ephraimbuddy committed Feb 22, 2024
1 parent 786e8dc commit 58a0026
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion airflow/models/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3248,7 +3248,6 @@ def ti_selector_condition(cls, vals: Collection[str | tuple[str, int]]) -> Colum

@classmethod
@internal_api_call
@Sentry.enrich_errors
@provide_session
def _schedule_downstream_tasks(
cls,
Expand Down
3 changes: 1 addition & 2 deletions airflow/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ def enrich_errors(self, func):
"""
Decorate errors.
Wrap TaskInstance._run_raw_task and LocalTaskJob._run_mini_scheduler_on_child_tasks
to support task specific tags and breadcrumbs.
Wrap TaskInstance._run_raw_task to support task specific tags and breadcrumbs.
"""
session_args_idx = find_session_idx(func)

Expand Down
2 changes: 1 addition & 1 deletion airflow/serialization/pydantic/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def schedule_downstream_tasks(self, session: Session = NEW_SESSION, max_tis_per_
:meta: private
"""
return TaskInstance._schedule_downstream_tasks(
ti=self, sessions=session, max_tis_per_query=max_tis_per_query
ti=self, session=session, max_tis_per_query=max_tis_per_query
)

def command_as_list(
Expand Down

0 comments on commit 58a0026

Please sign in to comment.