Adityamalik123 commented on code in PR #27633:
URL: https://github.com/apache/airflow/pull/27633#discussion_r1036416427
##########
airflow/providers/atlassian/jira/hooks/jira.py:
##########
@@ -43,48 +43,51 @@ def __init__(self, jira_conn_id: str = default_conn_name,
proxies: Any | None =
super().__init__()
self.jira_conn_id = jira_conn_id
self.proxies = proxies
- self.client: JIRA | None = None
+ self.client: Jira | None = None
self.get_conn()
- def get_conn(self) -> JIRA:
+ def get_conn(self) -> Jira:
if not self.client:
self.log.debug("Creating Jira client for conn_id: %s",
self.jira_conn_id)
- get_server_info = True
- validate = True
- extra_options = {}
+ verify = True
if not self.jira_conn_id:
raise AirflowException("Failed to create jira client. no
jira_conn_id provided")
conn = self.get_connection(self.jira_conn_id)
if conn.extra is not None:
extra_options = conn.extra_dejson
# only required attributes are taken for now,
- # more can be added ex: async, logging, max_retries
+ # more can be added ex: timeout, cloud, session
# verify
if "verify" in extra_options and
extra_options["verify"].lower() == "false":
- extra_options["verify"] = False
+ verify = False
# validate
- if "validate" in extra_options and
extra_options["validate"].lower() == "false":
- validate = False
-
- if "get_server_info" in extra_options and
extra_options["get_server_info"].lower() == "false":
- get_server_info = False
+ if "validate" in extra_options:
+ warnings.warn(
+ "Passing 'validate' in the connection is no longer
supported.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+
+ if "get_server_info" in extra_options:
+ warnings.warn(
+ "Passing 'get_server_info' in the connection is no
longer supported.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
try:
- self.client = JIRA(
- conn.host,
- options=extra_options,
- basic_auth=(conn.login, conn.password),
- get_server_info=get_server_info,
- validate=validate,
+ self.client = Jira(
+ url=conn.host,
+ username=conn.login,
+ password=conn.password,
+ verify_ssl=verify,
proxies=self.proxies,
)
- except JIRAError as jira_error:
+ except Exception as jira_error:
raise AirflowException(f"Failed to create jira client, jira
error: {str(jira_error)}")
Review Comment:
Made the changes here by only keeping the HTTPError to log the response from
it. Other will just raise with whatever exception that comes. Thanks for
identifying this.
--
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]