This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b2deab7514f Remove Provider Deprecations in Atlassian Jira (#44644)
b2deab7514f is described below

commit b2deab7514f0e872885b4c617bf017d0cec70cbc
Author: LIU ZHE YOU <[email protected]>
AuthorDate: Fri Dec 6 04:13:18 2024 +0800

    Remove Provider Deprecations in Atlassian Jira (#44644)
---
 .../airflow/providers/atlassian/jira/CHANGELOG.rst |  8 ++++++
 .../airflow/providers/atlassian/jira/hooks/jira.py | 15 +---------
 providers/tests/atlassian/jira/hooks/test_jira.py  | 32 ----------------------
 3 files changed, 9 insertions(+), 46 deletions(-)

diff --git a/providers/src/airflow/providers/atlassian/jira/CHANGELOG.rst 
b/providers/src/airflow/providers/atlassian/jira/CHANGELOG.rst
index 54c66ebf9e7..20586fa51ba 100644
--- a/providers/src/airflow/providers/atlassian/jira/CHANGELOG.rst
+++ b/providers/src/airflow/providers/atlassian/jira/CHANGELOG.rst
@@ -27,6 +27,14 @@
 Changelog
 ---------
 
+.. warning::
+   All deprecated classes, parameters and features have been removed from the 
Atlassian Jira provider package.
+   The following breaking changes were introduced:
+
+   * Hooks
+
+      * Removed the use of the ``verify`` extra parameters as a ``str`` from 
``JiraHook``. Use ``verify`` extra parameters as a ``bool`` instead.
+
 2.7.1
 .....
 
diff --git a/providers/src/airflow/providers/atlassian/jira/hooks/jira.py 
b/providers/src/airflow/providers/atlassian/jira/hooks/jira.py
index b4f3a207f03..7ebe60fb828 100644
--- a/providers/src/airflow/providers/atlassian/jira/hooks/jira.py
+++ b/providers/src/airflow/providers/atlassian/jira/hooks/jira.py
@@ -19,12 +19,11 @@
 
 from __future__ import annotations
 
-import warnings
 from typing import Any
 
 from atlassian import Jira
 
-from airflow.exceptions import AirflowException, 
AirflowProviderDeprecationWarning
+from airflow.exceptions import AirflowException
 from airflow.hooks.base import BaseHook
 
 
@@ -62,18 +61,6 @@ class JiraHook(BaseHook):
                 # only required attributes are taken for now,
                 # more can be added ex: timeout, cloud, session
 
-                # verify
-                if isinstance(verify, str):
-                    warnings.warn(
-                        "Extra parameter `verify` using str is deprecated and 
will be removed "
-                        "in a future release. Please use `verify` using bool 
instead.",
-                        AirflowProviderDeprecationWarning,
-                        stacklevel=2,
-                    )
-                    verify = True
-                    if extra_options["verify"].lower() == "false":
-                        verify = False
-
             self.client = Jira(
                 url=conn.host,
                 username=conn.login,
diff --git a/providers/tests/atlassian/jira/hooks/test_jira.py 
b/providers/tests/atlassian/jira/hooks/test_jira.py
index d90a91400f9..215fadddd93 100644
--- a/providers/tests/atlassian/jira/hooks/test_jira.py
+++ b/providers/tests/atlassian/jira/hooks/test_jira.py
@@ -21,7 +21,6 @@ from unittest import mock
 
 import pytest
 
-from airflow.exceptions import AirflowProviderDeprecationWarning
 from airflow.models import Connection
 from airflow.providers.atlassian.jira.hooks.jira import JiraHook
 
@@ -39,7 +38,6 @@ class TestJiraHook:
     @pytest.fixture(autouse=True)
     def setup_test_cases(self, monkeypatch):
         self.conn_id = "jira_default"
-        self.conn_id_with_str_verify = "jira_default_with_str"
         self.host = "https://localhost/jira/";
         self.port = 443
         self.login = "user"
@@ -60,20 +58,6 @@ class TestJiraHook:
                 )
             ),
         )
-        monkeypatch.setenv(
-            f"AIRFLOW_CONN_{self.conn_id_with_str_verify}".upper(),
-            connection_as_json(
-                Connection(
-                    conn_id=self.conn_id_with_str_verify,
-                    conn_type="jira",
-                    host="https://localhost/jira/";,
-                    port=443,
-                    login="user",
-                    password="password",
-                    extra='{"verify": "False", "project": "AIRFLOW"}',
-                )
-            ),
-        )
 
     def test_jira_client_connection(self, mocked_jira_client):
         jira_hook = JiraHook(proxies=self.proxies)
@@ -87,19 +71,3 @@ class TestJiraHook:
         )
         assert isinstance(jira_hook.client, mock.Mock)
         assert jira_hook.client.name == mocked_jira_client.return_value.name
-
-    def test_jira_client_connection_with_str(self, mocked_jira_client):
-        warning_message = "Extra parameter `verify` using str is deprecated 
and will be removed"
-
-        with pytest.warns(AirflowProviderDeprecationWarning, 
match=warning_message):
-            jira_hook = JiraHook(jira_conn_id=self.conn_id_with_str_verify, 
proxies=self.proxies)
-
-        mocked_jira_client.assert_called_once_with(
-            url=self.host,
-            username=self.login,
-            password=self.password,
-            verify_ssl=False,
-            proxies=self.proxies,
-        )
-        assert isinstance(jira_hook.client, mock.Mock)
-        assert jira_hook.client.name == mocked_jira_client.return_value.name

Reply via email to