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

weilee 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 9b90d2f216 Add debug logs to print Request/Response data in  
Databricks provider (#42662)
9b90d2f216 is described below

commit 9b90d2f216adf6aea1c5a53100e24c80ddb6efb7
Author: Kalyan <[email protected]>
AuthorDate: Thu Oct 3 03:24:08 2024 +0530

    Add debug logs to print Request/Response data in  Databricks provider 
(#42662)
    
    * add debug logs to print request/response data
    
    ---------
    
    Signed-off-by: kalyanr <[email protected]>
---
 airflow/providers/databricks/hooks/databricks_base.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/airflow/providers/databricks/hooks/databricks_base.py 
b/airflow/providers/databricks/hooks/databricks_base.py
index 4dd95d755c..fd2e456642 100644
--- a/airflow/providers/databricks/hooks/databricks_base.py
+++ b/airflow/providers/databricks/hooks/databricks_base.py
@@ -561,6 +561,13 @@ class BaseDatabricksHook(BaseHook):
         try:
             for attempt in self._get_retry_object():
                 with attempt:
+                    self.log.debug(
+                        "Initiating %s request to %s with payload: %s, 
headers: %s",
+                        method,
+                        url,
+                        json,
+                        headers,
+                    )
                     response = request_func(
                         url,
                         json=json if method in ("POST", "PATCH") else None,
@@ -569,6 +576,8 @@ class BaseDatabricksHook(BaseHook):
                         headers=headers,
                         timeout=self.timeout_seconds,
                     )
+                    self.log.debug("Response Status Code: %s", 
response.status_code)
+                    self.log.debug("Response text: %s", response.text)
                     response.raise_for_status()
                     return response.json()
         except RetryError:
@@ -615,6 +624,13 @@ class BaseDatabricksHook(BaseHook):
         try:
             async for attempt in self._a_get_retry_object():
                 with attempt:
+                    self.log.debug(
+                        "Initiating %s request to %s with payload: %s, 
headers: %s",
+                        method,
+                        url,
+                        json,
+                        headers,
+                    )
                     async with request_func(
                         url,
                         json=json,
@@ -622,6 +638,8 @@ class BaseDatabricksHook(BaseHook):
                         headers={**headers, **self.user_agent_header},
                         timeout=self.timeout_seconds,
                     ) as response:
+                        self.log.debug("Response Status Code: %s", 
response.status_code)
+                        self.log.debug("Response text: %s", response.text)
                         response.raise_for_status()
                         return await response.json()
         except RetryError:

Reply via email to