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


##########
airflow-core/src/airflow/serialization/definitions/deadline.py:
##########
@@ -380,11 +378,35 @@ def _fetch_from_db(column, *, session: Session, dag_id: 
str, run_id: str) -> dat
     return result
 
 
[email protected](frozen=True)
+class SerializedVariableInterval:
+    """Core-side serialized representation of a variable-backed deadline 
interval."""
+
+    key: str
+
+    def resolve(self) -> timedelta:
+        from airflow.models.variable import Variable
+
+        try:
+            value = Variable.get(self.key)
+        except KeyError as e:

Review Comment:
   Sorry, I'm confusing things and you don't need to change anything here.
   
   You're right that it doesn't raise from the scheduler since it never imports 
`task_runner`.
   
   The actual fix I needed to see is on this block but in another PR.  I think 
the cleanest way to get where I was trying to go with that will be to make sure 
this PR merges before #71968, then in that one I can add `session` to 
`resolve()` and pass it forward into the  `Variable.get()` call in this try 
block.  Then if `SUPERVISOR_COMMS` ever does end up set in the scheduler, that 
path then fails loudly with a message that names the problem rather than 
quietly routing through the SDK.
   



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