kosiew commented on code in PR #64960:
URL: https://github.com/apache/airflow/pull/64960#discussion_r3295862848


##########
providers/databricks/src/airflow/providers/databricks/triggers/databricks.py:
##########
@@ -53,6 +54,7 @@ def __init__(
         caller: str = "DatabricksExecutionTrigger",
     ) -> None:
         super().__init__()
+        validate_deferrable_databricks_retry_args(retry_args, owner=caller)

Review Comment:
   Yes, intentionally. For deferrable execution the trigger kwargs must be 
serialization-safe as soon as the trigger is created, because the trigger is 
passed through Airflow's trigger serialization boundary. If we allow the 
trigger instance to be created with non-serializable `retry_args`, the failure 
moves later into generic serialization code and the user loses the 
Databricks-specific guidance.
   
   This also matches the issue scope: fail fast with a clear `ValueError`, and 
ensure the Databricks trigger does not accept unsupported callable retry args. 
Constructor-time validation keeps invalid trigger state from existing at all.
   
   There is precedent for trigger constructors rejecting invalid arguments, 
e.g. `S3KeysUnchangedTrigger` validates negative `inactivity_period`, MWAA 
triggers validate conflicting states, and `DateTimeTrigger` rejects naive 
datetimes. So this is not meant as a broad gatekeeper pattern, only validation 
for an argument that cannot safely cross the deferrable boundary.
   



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