rich7420 commented on code in PR #56808: URL: https://github.com/apache/airflow/pull/56808#discussion_r2442351205
########## airflow-core/src/airflow/api_fastapi/execution_api/datamodels/hitl.py: ########## @@ -17,13 +17,14 @@ from __future__ import annotations from datetime import datetime -from typing import Any +from typing import Any, cast Review Comment: We need to import `cast` to handle type compatibility between `UtcDateTime` and `datetime` types for SQLAlchemy 2 migration. The `responded_at` field returns `UtcDateTime | None` from the ORM, but our Pydantic model expects `datetime | None`. Using `cast(datetime | None, hitl_detail.responded_at)` tells MyPy these types are compatible without runtime changes. This is cleaner than using `# type: ignore[arg-type]` comments and maintains type safety. -- 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]
