atul-astronomer opened a new issue, #63438:
URL: https://github.com/apache/airflow/issues/63438

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   ```typescript
   2026-03-12T10:00:06.255989Z [error    ] Failed to write serialized DAG 
dag_id=deadline_alert_example fileloc=/files/dags/deadline_alert_example.py 
[airflow.dag_processing.collection] loc=collection.py:290
   Traceback (most recent call last):
     File "/opt/airflow/airflow-core/src/airflow/dag_processing/collection.py", 
line 273, in _serialize_dag_capturing_errors
       dag_was_updated = SerializedDagModel.write_dag(
     File "/opt/airflow/airflow-core/src/airflow/utils/session.py", line 98, in 
wrapper
       return func(*args, **kwargs)
     File "/opt/airflow/airflow-core/src/airflow/models/serialized_dag.py", 
line 568, in write_dag
       deadline_uuid_mapping = cls._try_reuse_deadline_uuids(
     File "/opt/airflow/airflow-core/src/airflow/models/serialized_dag.py", 
line 449, in _try_reuse_deadline_uuids
       existing_deadline_uuids_as_uuid = [UUID(uid) for uid in 
existing_deadline_uuids]
     File "/opt/airflow/airflow-core/src/airflow/models/serialized_dag.py", 
line 449, in <listcomp>
       existing_deadline_uuids_as_uuid = [UUID(uid) for uid in 
existing_deadline_uuids]
     File "/usr/python/lib/python3.10/uuid.py", line 174, in __init__
       hex = hex.replace('urn:', '').replace('uuid:', '')
   AttributeError: 'dict' object has no attribute 'replace'
   ``` 
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Perform migration from 3.1 to 3.2 using below Dag:
   
   ```python
   from datetime import datetime, timedelta
   from airflow.sdk import DAG
   
   
   from airflow.providers.standard.operators.empty import EmptyOperator
   from airflow.sdk.definitions.deadline import AsyncCallback, 
DeadlineReference, DeadlineAlert
   async def custom_async_callback(**kwargs):
       """Handle deadline violation with custom logic."""
       context = kwargs.get("context", {})
       print(f"Deadline exceeded for Dag {context.get('dag_run', 
{}).get('dag_id')}!")
       print(f"Context: {context}")
       print(f"Alert type: {kwargs.get('alert_type')}")
       # Additional custom handling here
   
   
   with DAG(
       dag_id="deadline_alert_example",
       deadline=DeadlineAlert(
           reference=DeadlineReference.DAGRUN_QUEUED_AT,
           interval=timedelta(minutes=15),
           callback=AsyncCallback(
               custom_async_callback,
               kwargs={
                   "text": "🚨 Dag {{ dag_run.dag_id }} missed deadline at {{ 
deadline.deadline_time }}. DagRun: {{ dag_run }}"
               },
           ),
       ),
   ):
       EmptyOperator(task_id="example_task")
   ``` 
   
   
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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