This is an automated email from the ASF dual-hosted git repository.

vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new f78196710b0 fix: fix mypy errors in api_fastapi/logging/ (#57096)
f78196710b0 is described below

commit f78196710b0f022214a0d134c5ff6255b1c62ae0
Author: Zhen-Lun (Kevin) Hong <[email protected]>
AuthorDate: Thu Oct 23 02:45:39 2025 +0800

    fix: fix mypy errors in api_fastapi/logging/ (#57096)
---
 airflow-core/src/airflow/api_fastapi/logging/decorators.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/airflow-core/src/airflow/api_fastapi/logging/decorators.py 
b/airflow-core/src/airflow/api_fastapi/logging/decorators.py
index d5a073f3044..4c09f4b5dc8 100644
--- a/airflow-core/src/airflow/api_fastapi/logging/decorators.py
+++ b/airflow-core/src/airflow/api_fastapi/logging/decorators.py
@@ -19,6 +19,7 @@ from __future__ import annotations
 import itertools
 import json
 import logging
+from datetime import datetime
 
 import pendulum
 from fastapi import Request
@@ -157,7 +158,10 @@ def action_logging(event: str | None = None):
             logical_date_value = request.query_params.get("logical_date")
             if logical_date_value:
                 try:
-                    log.logical_date = pendulum.parse(logical_date_value, 
strict=False)
+                    logical_date = pendulum.parse(logical_date_value, 
strict=False)
+                    if not isinstance(logical_date, datetime):
+                        raise ParserError
+                    log.logical_date = logical_date
                 except ParserError:
                     logger.exception("Failed to parse logical_date from the 
request: %s", logical_date_value)
             else:

Reply via email to