You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/09 13:42:18 UTC

[GitHub] [airflow] robinedwards opened a new pull request #18119: Fix Sentry handler from LocalTaskJob causing error

robinedwards opened a new pull request #18119:
URL: https://github.com/apache/airflow/pull/18119


   The `enrich_errors` method assumes the first argument to the function
   its wrapping is a method on a `TaskInstance` when in fact it can also be a `LocalTaskJob`. In the case of the mini scheduler :  https://github.com/apache/airflow/blob/944dcfbb918050274fd3a1cc51d8fdf460ea2429/airflow/jobs/local_task_job.py#L224
   
   I believe this issue was introduced with https://github.com/apache/airflow/pull/16289
   
   This is now handled by extracting the task_instance from the LocalTaskJob
   
   Closes #18118


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil merged pull request #18119: Fix Sentry handler from LocalTaskJob causing error

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #18119:
URL: https://github.com/apache/airflow/pull/18119


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #18119: Fix Sentry handler from LocalTaskJob causing error

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #18119:
URL: https://github.com/apache/airflow/pull/18119#issuecomment-916186033


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on a change in pull request #18119: Fix Sentry handler from LocalTaskJob causing error

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #18119:
URL: https://github.com/apache/airflow/pull/18119#discussion_r705505821



##########
File path: airflow/sentry.py
##########
@@ -159,8 +162,14 @@ def wrapper(task_instance, *args, **kwargs):
 
                 with sentry_sdk.push_scope():
                     try:
-                        return func(task_instance, *args, **kwargs)
+                        return func(_self, *args, **kwargs)
                     except Exception as e:
+                        # Is a LocalTaskJob
+                        if hasattr(_self, 'task_instance'):
+                            task_instance = _self
+                        else:
+                            task_instance = _self

Review comment:
       Same command in if/else?, do we even need the condition check then?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #18119: Fix Sentry handler from LocalTaskJob causing error

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #18119:
URL: https://github.com/apache/airflow/pull/18119#discussion_r705614294



##########
File path: airflow/sentry.py
##########
@@ -159,8 +162,14 @@ def wrapper(task_instance, *args, **kwargs):
 
                 with sentry_sdk.push_scope():
                     try:
-                        return func(task_instance, *args, **kwargs)
+                        return func(_self, *args, **kwargs)
                     except Exception as e:
+                        # Is a LocalTaskJob
+                        if hasattr(_self, 'task_instance'):
+                            task_instance = _self
+                        else:
+                            task_instance = _self

Review comment:
       You aren't the only one to miss it!




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] robinedwards commented on a change in pull request #18119: Fix Sentry handler from LocalTaskJob causing error

Posted by GitBox <gi...@apache.org>.
robinedwards commented on a change in pull request #18119:
URL: https://github.com/apache/airflow/pull/18119#discussion_r705584117



##########
File path: airflow/sentry.py
##########
@@ -159,8 +162,14 @@ def wrapper(task_instance, *args, **kwargs):
 
                 with sentry_sdk.push_scope():
                     try:
-                        return func(task_instance, *args, **kwargs)
+                        return func(_self, *args, **kwargs)
                     except Exception as e:
+                        # Is a LocalTaskJob
+                        if hasattr(_self, 'task_instance'):
+                            task_instance = _self
+                        else:
+                            task_instance = _self

Review comment:
       Christ thanks for spotting this I'd some how missed the vital bit , just updated with the correct logic




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org