kaxil commented on code in PR #67890:
URL: https://github.com/apache/airflow/pull/67890#discussion_r3342964859


##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########
@@ -558,7 +558,12 @@ def set(self, key: str, value: JsonValue, *, retention: 
timedelta | None = None)
             expires_at = now + retention
         else:
             days = conf.getint("state_store", "default_retention_days")
-            expires_at = None if days <= 0 else now + timedelta(days=days)
+            if days < 0:

Review Comment:
   `default_retention_days` is a deploy-wide static setting, so a negative 
value is a misconfig that's identical for every task. Validating it here means 
the error only surfaces when a task actually calls `set(retention=None)`, and 
on the SDK side it shows up as a task failure mid-run rather than at startup. 
Did you consider validating once at config load so a bad value fails the 
deployment early instead? Not blocking, the per-write check is already better 
than the silent corruption it replaces, just curious about the trade-off.



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