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

phanikumv 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 58e21c66fd fix(providers/databricks): remove the execute method from 
to-be-deprecated DatabricksRunNowDeferrableOperator (#32806)
58e21c66fd is described below

commit 58e21c66fdcc8a416a697b4efa852473ad8bd6fc
Author: Wei Lee <[email protected]>
AuthorDate: Tue Jul 25 11:21:41 2023 +0800

    fix(providers/databricks): remove the execute method from to-be-deprecated 
DatabricksRunNowDeferrableOperator (#32806)
    
    As mentioned in #27837, we should do something similar to 
DatabricksRunOperator instead of running the original executing logic in 
DatabricksRunNowDeferrableOperator This is due to a bug that causes issues with 
empty job IDs. The DatabricksRunNowOperator operates smoothly and supports 
deferrable mode, so this PR removes the malfunctioning execute method.
---
 airflow/providers/databricks/operators/databricks.py    | 5 -----
 tests/providers/databricks/operators/test_databricks.py | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/airflow/providers/databricks/operators/databricks.py 
b/airflow/providers/databricks/operators/databricks.py
index b1c51a3f85..ec5d007255 100644
--- a/airflow/providers/databricks/operators/databricks.py
+++ b/airflow/providers/databricks/operators/databricks.py
@@ -697,8 +697,3 @@ class 
DatabricksRunNowDeferrableOperator(DatabricksRunNowOperator):
             stacklevel=2,
         )
         super().__init__(deferrable=True, *args, **kwargs)
-
-    def execute(self, context):
-        hook = self._get_hook(caller="DatabricksRunNowDeferrableOperator")
-        self.run_id = hook.run_now(self.json)
-        _handle_deferrable_databricks_operator_execution(self, hook, self.log, 
context)
diff --git a/tests/providers/databricks/operators/test_databricks.py 
b/tests/providers/databricks/operators/test_databricks.py
index 32413329f6..81379ea339 100644
--- a/tests/providers/databricks/operators/test_databricks.py
+++ b/tests/providers/databricks/operators/test_databricks.py
@@ -905,7 +905,7 @@ class TestDatabricksRunNowDeferrableOperator:
             retry_limit=op.databricks_retry_limit,
             retry_delay=op.databricks_retry_delay,
             retry_args=None,
-            caller="DatabricksRunNowDeferrableOperator",
+            caller="DatabricksRunNowOperator",
         )
 
         db_mock.run_now.assert_called_once_with(expected)

Reply via email to