dylanbstorey commented on code in PR #30175:
URL: https://github.com/apache/airflow/pull/30175#discussion_r1167630051


##########
airflow/providers/apache/kafka/hooks/client.py:
##########
@@ -0,0 +1,65 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from typing import Any, Sequence
+
+from confluent_kafka.admin import AdminClient, NewTopic
+
+from airflow.providers.apache.kafka.hooks.base import KafkaHook
+
+
+class KafkaAdminClientHook(KafkaHook):
+    """
+    A hook for interacting with the Kafka Cluster
+
+    :param kafka_config_id: The connection object to use, defaults to 
"kafka_default"
+    """
+
+    def __init__(self, kafka_config_id=KafkaHook.default_conn_name) -> None:
+        super().__init__(kafka_config_id=kafka_config_id)
+
+    def get_admin_client(self) -> AdminClient:
+        """returns an AdminClient for communicating with the cluster
+
+        :return: an interactive admin client for the Kafka cluster
+        :rtype: AdminClient
+        """
+        client = AdminClient(self.get_conn)
+        return client
+
+    def create_topic(
+        self,
+        topics: Sequence[Sequence[Any]],

Review Comment:
   >the topics list format and arguments order is not clear in the docstring.
   
   Added flavor. 
   
   >IMHO we can create a dataclass in the provider with the 3 used fields, and 
the user can import it to provide the list, also we can support a list of 
NewTopic as we do in the KPO, in this case the can also use the kafka NewTopic.
   
   Valid strategies all. I don't really have strong feelings about it beyond we 
can delay the decision to discuss more. 



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

Reply via email to