Skip to content

Commit

Permalink
fix(providers/databricks): remove the execute method from to-be-depre…
Browse files Browse the repository at this point in the history
…cated DatabricksRunNowDeferrableOperator (apache#32806)

As mentioned in apache#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.
  • Loading branch information
Lee-W authored Jul 25, 2023
1 parent c4b6f06 commit 58e21c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions airflow/providers/databricks/operators/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,3 @@ def __init__(self, *args, **kwargs):
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)
2 changes: 1 addition & 1 deletion tests/providers/databricks/operators/test_databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def test_execute_task_deferred(self, db_mock_class):
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)
Expand Down

0 comments on commit 58e21c6

Please sign in to comment.