pierrejeambrun commented on code in PR #42959:
URL: https://github.com/apache/airflow/pull/42959#discussion_r1803125751
##########
airflow/api_fastapi/routes/public/dags.py:
##########
@@ -95,6 +98,31 @@ async def get_dags(
)
+@dags_router.get(
+ "/tags",
+ responses=create_openapi_http_exception_doc([401, 403]),
+)
+async def get_dag_tags(
+ limit: QueryLimit,
+ offset: QueryOffset,
+ order_by: QueryDagTagOrderBy,
+ tag_name_pattern: QueryDagTagPatternSearch,
+ session: Annotated[Session, Depends(get_session)],
+) -> DAGTagCollectionResponse:
+ """Get all DAG tags."""
+ base_select = select(distinct(DagTag.name))
+ dag_tags_select, total_entries = paginated_select(
+ base_select=base_select,
+ filters=[tag_name_pattern],
+ order_by=order_by,
+ offset=offset,
+ limit=limit,
+ session=session,
+ )
+ dag_tags = session.execute(dag_tags_select).scalars().all()
+ return DAGTagCollectionResponse(tags=[dag_tag for dag_tag in dag_tags],
total_entries=total_entries)
+
Review Comment:
Yes, this is much more consistent with the rest of the endpoints.
##########
airflow/api_fastapi/parameters.py:
##########
@@ -129,6 +129,26 @@ def transform_aliases(self, value: str | None) -> str |
None:
return value
+class _OrderByParam(BaseParam[str]):
Review Comment:
What is the difference with `SortParam` of that same file ?
--
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]