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


##########
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:
   #71968 adds an optional keyword-only `session` to `Variable.get` for exactly 
this, so `resolve()` would take a session and forward it.  That also settles 
the question above: with a session passed, #71968 rejects the execution-context 
path outright rather than delegating to the SDK Variable, so 
`AirflowRuntimeError` cannot arise from it and there is no SDK import needed 
here.
   
   
   If #70370 lands first, `resolve_deadline_alert_interval()` becomes the only 
caller of `resolve()` and needs the parameter too.



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