tirkarthi commented on PR #56478:
URL: https://github.com/apache/airflow/pull/56478#issuecomment-3382622204

   Something like this can be added in the API side that should sort tags by 
name.
   
   ```diff
   diff --git 
a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py 
b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py
   index 23aa4ec300..3ff50fd2b5 100644
   --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py
   +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py
   @@ -29,6 +29,7 @@ from pydantic import (
        ConfigDict,
        computed_field,
        field_validator,
   +    field_serializer
    )
    
    from airflow.api_fastapi.core_api.base import BaseModel, StrictBaseModel
   @@ -114,6 +115,9 @@ class DAGResponse(BaseModel):
            }
            return serializer.dumps(payload)
    
   +    @field_serializer('tags')
   +    def serialize_dagtags(tags: list[DagTagResponse]):
   +        return sorted(tags, key=lambda tag: tag.name)
   ```


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