From 22fe304ee49d0f535dab552bde9f3bf836622a98 Mon Sep 17 00:00:00 2001
From: Jarek Potiuk <jarek@potiuk.com>
Date: Sat, 1 Mar 2025 11:34:01 +0100
Subject: [PATCH] Remove exclusions of confluent-kafka

Confluent-kafka 2.8.1 buggy release (no wheels) has been yanked so
we do not need to exclude it any more and we can remove the
limitation added for constraint generation.
---
 Dockerfile.ci                                             | 5 +----
 generated/provider_dependencies.json                      | 2 +-
 providers/apache/kafka/README.rst                         | 8 ++++----
 providers/apache/kafka/pyproject.toml                     | 5 +----
 .../airflow/providers/apache/kafka/get_provider_info.py   | 2 +-
 5 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/Dockerfile.ci b/Dockerfile.ci
index dc171df6cb72b..277a746de58b6 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -1283,11 +1283,8 @@ COPY . ${AIRFLOW_SOURCES}/
 # Those are additional constraints that are needed for some extras but we do not want to
 # force them on the main Airflow package. Currently we need no extra limits as PIP 23.1+ has much better
 # dependency resolution and we do not need to limit the versions of the dependencies
-# The `confluent-kafka==2.8.1` currently breaks installation of kafka provider from PyPI
-# So we need to add limit here to get our constraints generation for PyPI packages work
-# This can be removed when https://github.com/confluentinc/confluent-kafka-python/issues/1927 is solved
 #
-ARG EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS="confluent-kafka!=2.8.1"
+ARG EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS=""
 ARG UPGRADE_INVALIDATION_STRING=""
 ARG VERSION_SUFFIX_FOR_PYPI=""
 
diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json
index 2d1cbdb47f935..45b7eb2648531 100644
--- a/generated/provider_dependencies.json
+++ b/generated/provider_dependencies.json
@@ -218,7 +218,7 @@
     "deps": [
       "apache-airflow>=2.9.0",
       "asgiref>=2.3.0",
-      "confluent-kafka>=2.3.0,!=2.8.1"
+      "confluent-kafka>=2.3.0"
     ],
     "devel-deps": [],
     "plugins": [],
diff --git a/providers/apache/kafka/README.rst b/providers/apache/kafka/README.rst
index 98e182fcf0c9e..cfa6d23c9f7dd 100644
--- a/providers/apache/kafka/README.rst
+++ b/providers/apache/kafka/README.rst
@@ -50,13 +50,13 @@ The package supports the following python versions: 3.9,3.10,3.11,3.12
 Requirements
 ------------
 
-===================  ===================
+===================  ==================
 PIP package          Version required
-===================  ===================
+===================  ==================
 ``apache-airflow``   ``>=2.9.0``
 ``asgiref``          ``>=2.3.0``
-``confluent-kafka``  ``>=2.3.0,!=2.8.1``
-===================  ===================
+``confluent-kafka``  ``>=2.3.0``
+===================  ==================
 
 The changelog for the provider package can be found in the
 `changelog <https://airflow.apache.org/docs/apache-airflow-providers-apache-kafka/1.7.0/changelog.html>`_.
diff --git a/providers/apache/kafka/pyproject.toml b/providers/apache/kafka/pyproject.toml
index 0d32cbb4d76f1..51c6126c5cab5 100644
--- a/providers/apache/kafka/pyproject.toml
+++ b/providers/apache/kafka/pyproject.toml
@@ -59,10 +59,7 @@ requires-python = "~=3.9"
 dependencies = [
     "apache-airflow>=2.9.0",
     "asgiref>=2.3.0",
-    # Confluent kafka 2.8.1 has been released without binary wheels on 28 Feb 2025
-    # It's likely this will be fixed, but until it is, we need to exclude it
-    # See https://github.com/confluentinc/confluent-kafka-python/issues/1927
-    "confluent-kafka>=2.3.0,!=2.8.1",
+    "confluent-kafka>=2.3.0",
 ]
 
 [project.urls]
diff --git a/providers/apache/kafka/src/airflow/providers/apache/kafka/get_provider_info.py b/providers/apache/kafka/src/airflow/providers/apache/kafka/get_provider_info.py
index 812f792ccb458..97287ea00e267 100644
--- a/providers/apache/kafka/src/airflow/providers/apache/kafka/get_provider_info.py
+++ b/providers/apache/kafka/src/airflow/providers/apache/kafka/get_provider_info.py
@@ -89,5 +89,5 @@ def get_provider_info():
                 "connection-type": "kafka",
             }
         ],
-        "dependencies": ["apache-airflow>=2.9.0", "asgiref>=2.3.0", "confluent-kafka>=2.3.0,!=2.8.1"],
+        "dependencies": ["apache-airflow>=2.9.0", "asgiref>=2.3.0", "confluent-kafka>=2.3.0"],
     }
