SameerMesiah97 opened a new pull request, #62393:
URL: https://github.com/apache/airflow/pull/62393

   **Description**
   
   This change ensures that `DatabricksRunNowOperator` raises a clear 
`AirflowException` when `cancel_previous_runs=True` is set without specifying 
either `job_id` or `job_name`. Previously, the operator failed with a raw 
`KeyError` at execution time.
   
   The behavior remains unchanged for valid configurations. This update aligns 
the operator with existing validation patterns by surfacing configuration 
errors as `AirflowException` rather than internal Python errors.
   
   **Rationale**
   
   `DatabricksRunNowOperator` already performs validation for conflicting and 
missing parameters using `AirflowException`. In this specific branch, however, 
an invalid configuration surfaced as a raw `KeyError`, which exposes internal 
implementation details and produces inconsistent error semantics.
   
   Raising an `AirflowException` provides clearer feedback to DAG authors and 
keeps validation behavior consistent across the operator.
   
   **Tests**
   
   A unit test has been added to verify that an `AirflowException` is raised 
when `cancel_previous_runs=True` is used without a job identifier.
   
   **Backwards Compatibility**
   
   This change does not modify valid execution paths or operator semantics. It 
only replaces an unintended `KeyError` with an `AirflowException`.
   
   Closes: #62392 
   


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