ha2hi commented on code in PR #64766:
URL: https://github.com/apache/airflow/pull/64766#discussion_r3147406494
##########
providers/databricks/tests/unit/databricks/operators/test_databricks.py:
##########
@@ -603,6 +604,44 @@ def test_exec_update_job_permission_with_empty_acl(self,
db_mock_class):
db_mock.update_job_permission.assert_not_called()
+class TestDatabricksDeleteJobsOperator:
+
@mock.patch("airflow.providers.databricks.operators.databricks.DatabricksHook")
+ def test_execute(self, mock_hook_class):
+ # Set up the mock hook instance
+ mock_hook = mock_hook_class.return_value
+
+ # Instantiate the DatabricksDeleteJobOperator
+ op = DatabricksDeleteJobsOperator(
+ task_id="delete_job_task",
+ job_id=12345,
+ databricks_conn_id="databricks_default",
+ )
+
+ # Execute the operator
+ op.execute({})
+
+ # Verify that the DatabricksHook was initialized with the correct
connection ID and default retry arguments
+ mock_hook_class.assert_called_once_with(
+ "databricks_default",
+ retry_limit=3,
+ retry_delay=1,
+ retry_args=None,
Review Comment:
Good point. I'll replace the hard-coded literals with operator attributes
(e.g., op.databricks_retry_limit) to avoid test brittleness and maintain
consistency.
--
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]