Lee-W commented on code in PR #38962:
URL: https://github.com/apache/airflow/pull/38962#discussion_r1562724552


##########
airflow/providers/databricks/hooks/databricks.py:
##########
@@ -656,14 +655,20 @@ def get_repo_by_path(self, path: str) -> str | None:
 
         return None
 
-    def update_job_permission(self, json: dict[str, Any]) -> dict:
+    def update_job_permission(self, job_id: int, json: dict[str, Any]) -> dict:
         """
         Update databricks job permission.
 
+        :param job_id: job id
         :param json: payload
         :return: json containing permission specification
         """
-        return self._do_api_call(UPDATE_PERMISSION_ENDPOINT, json)
+        response = {}
+        try:
+            response = self._do_api_call(("PATCH", 
f"api/2.0/permissions/jobs/{job_id}"), json)
+        except Exception as e:
+            print("Could not update permission ", e)

Review Comment:
   I guess reraise makes more sense in this case



##########
airflow/providers/databricks/hooks/databricks.py:
##########
@@ -656,14 +655,20 @@ def get_repo_by_path(self, path: str) -> str | None:
 
         return None
 
-    def update_job_permission(self, json: dict[str, Any]) -> dict:
+    def update_job_permission(self, job_id: int, json: dict[str, Any]) -> dict:
         """
         Update databricks job permission.
 
+        :param job_id: job id
         :param json: payload
         :return: json containing permission specification
         """
-        return self._do_api_call(UPDATE_PERMISSION_ENDPOINT, json)
+        response = {}
+        try:
+            response = self._do_api_call(("PATCH", 
f"api/2.0/permissions/jobs/{job_id}"), json)
+        except Exception as e:
+            print("Could not update permission ", e)

Review Comment:
   I think we probably should use logging instead of print or reraise?



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