hussein-awala commented on code in PR #33796:
URL: https://github.com/apache/airflow/pull/33796#discussion_r1314009187


##########
airflow/providers/apache/druid/hooks/druid.py:
##########
@@ -149,6 +154,20 @@ def submit_indexing_job(
 
         self.log.info("Successful index")
 
+    def test_connection(self) -> tuple[bool, str]:
+        try:
+            conn = self.get_connection(self.druid_ingest_conn_id)
+            host = conn.host
+            port = conn.port
+            # ref : 
https://druid.apache.org/docs/latest/operations/api-reference/#tasks
+            response = 
requests.get(f"http://{host}:{port}/druid/indexer/v1/tasks";)

Review Comment:
   One of the main reasons for connection and test_connection method is storing 
the credentials securely and test them via this method, so IMHO this method 
should test if the credentials are valid or not. You can try something like:
   ```suggestion
               response = requests.get(
                   f"http://{host}:{port}/druid/indexer/v1/tasks";,
                    auth=self.get_auth(),
                )
   ```



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