uranusjr commented on code in PR #56808:
URL: https://github.com/apache/airflow/pull/56808#discussion_r2446816286
##########
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/hitl.py:
##########
@@ -75,10 +75,27 @@ def from_hitl_detail_orm(cls, hitl_detail: HITLDetail) ->
HITLDetailResponse:
else None
)
+ # Convert UtcDateTime to datetime for Pydantic compatibility
+ responded_at_datetime = None
+ if hitl_detail.responded_at is not None:
+ # Convert UtcDateTime to standard datetime
+ responded_at_datetime = datetime(
+ year=hitl_detail.responded_at.year,
+ month=hitl_detail.responded_at.month,
+ day=hitl_detail.responded_at.day,
+ hour=hitl_detail.responded_at.hour,
+ minute=hitl_detail.responded_at.minute,
+ second=hitl_detail.responded_at.second,
+ microsecond=hitl_detail.responded_at.microsecond,
+ tzinfo=hitl_detail.responded_at.tzinfo,
+ )
+
return HITLDetailResponse(
response_received=hitl_detail.response_received,
- responded_at=hitl_detail.responded_at,
+ responded_at=responded_at_datetime,
responded_by_user=hitl_user,
- chosen_options=hitl_detail.chosen_options,
+ chosen_options=hitl_detail.chosen_options
+ if isinstance(hitl_detail.chosen_options, list)
+ else None,
Review Comment:
Why is this needed
--
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]