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 2022/12/05 09:02:31 UTC

[GitHub] [airflow] eladkal commented on a diff in pull request #27633: Changing atlassian JIRA SDK to official atlassian-python-api SDK

eladkal commented on code in PR #27633:
URL: https://github.com/apache/airflow/pull/27633#discussion_r1039320387


##########
airflow/providers/atlassian/jira/operators/jira.py:
##########
@@ -76,16 +78,14 @@ def execute(self, context: Context) -> Any:
                 hook = JiraHook(jira_conn_id=self.jira_conn_id)
                 resource = hook.client
 
-            # Current Jira-Python SDK (1.0.7) has issue with pickling the jira response.
-            # ex: self.xcom_push(context, key='operator_response', value=jira_response)
-            # This could potentially throw error if jira_result is not picklable
             jira_result = getattr(resource, self.method_name)(**self.jira_method_args)
+
+            output = jira_result.get("id", None) if jira_result is not None else None
+            self.xcom_push(context, key="id", value=output)
+
             if self.result_processor:
                 return self.result_processor(context, jira_result)
 
             return jira_result
-
-        except JIRAError as jira_error:
-            raise AirflowException(f"Failed to execute jiraOperator, error: {str(jira_error)}")
-        except Exception as e:
-            raise AirflowException(f"Jira operator error: {str(e)}")
+        except HTTPError as e:
+            raise AirflowException(f"Failed to execute jiraOperator, error: {str(e.response)}")

Review Comment:
   I think we don't really need this?
   the error from the sdk will simply populate to Airflow and will fail the task.. there is not need to wrap it with Airflow exception



-- 
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