ferruzzi commented on code in PR #61461:
URL: https://github.com/apache/airflow/pull/61461#discussion_r2898302709


##########
airflow-core/src/airflow/models/deadline_alert.py:
##########
@@ -86,6 +86,8 @@ def matches_definition(self, other: DeadlineAlert) -> bool:
     @property
     def reference_class(self) -> 
type[SerializedReferenceModels.SerializedBaseDeadlineReference]:
         """Return the deserialized reference class."""
+        if "__class_path" in self.reference:
+            return SerializedReferenceModels.SerializedCustomReference

Review Comment:
   If you are thinking about changing this, perhaps consider flipping this 
logic?  If you were to add a helper in `SerializedReferenceModels` something 
like:
   
   ```python
   @classmethod
   def get_builtin_references(cls):
       return frozenset(
           reference.__name__ for reference in vars(cls).values()
           if issubclass(reference, cls.SerializedBaseDeadlineReference) 
           and reference is not cls.SerializedBaseDeadlineReference) # may not 
be needed?? do we care if base is included?
       )
   ```
   
   I think that should return a frozen set of all built-in reference types.  
Then you can flip your code here to "if it's in the set of built-ins do X else 
it must be a custom so do Y"



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