TypeError: Object of type datetime is not JSON serializable
DAG lora_decode
from Airflow 2.4.1 raises this error when passing recep_time
to XCOM :
ERROR - Could not serialize the XCom value into JSON.
Because of Python error:
TypeError: Object of type datetime is not JSON serializable
Airflow 2.6.1 (in dev) does not raise this error because Non-JSON-serializable params are handled.
But Non-JSON-serializable params are deprecated (#21135) and will be removed in Airflow 3.0.
So let's pass recep_time
as str instead of datetime to fix this issue !