SameerMesiah97 commented on code in PR #73294:
URL: https://github.com/apache/airflow/pull/73294#discussion_r4051344428


##########
task-sdk/src/airflow/sdk/definitions/deadline.py:
##########
@@ -154,14 +154,22 @@ def __init__(
         callback: Callback,
         name: str | None = None,
     ):
+        if not isinstance(interval, (timedelta, VariableInterval)):
+            raise ValueError(
+                f"Interval must be a `timedelta` or a `VariableInterval`, 
received {type(interval).__name__}."
+            )
+
+        # Serializing blocks subclasses for security reasons, so isinstance is 
too loose.
+        if type(callback) not in {AsyncCallback, SyncCallback}:
+            raise ValueError(
+                f"Callbacks must be `AsyncCallback` or `SyncCallback`, 
received {type(callback).__name__}."
+            )

Review Comment:
   Okay. I see you are using the SerializaedDeadlineAlert class as a parameter 
for that failing test case. That’s fine with me too. 
   
   As long as we don’t couple core imports to the sdk, it’s not an issue. 



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