gdivya6028 commented on code in PR #68785:
URL: https://github.com/apache/airflow/pull/68785#discussion_r3507195023


##########
airflow-core/src/airflow/api_fastapi/common/parameters.py:
##########
@@ -872,6 +851,31 @@ def depends(
     ) -> _TagsFilter:
         return cls().set_value(_TagFilterModel(tags=tags, 
tags_match_mode=tags_match_mode))
 
+class _DagTagFilterModel(BaseModel):
+    """Tag Filter Model with a match mode parameter."""
+
+    tags: list[str]
+
+class _DagTagsFilter(BaseParam[_DagTagFilterModel]):
+
+    def to_orm(self, select: Select) -> Select:
+        if self.skip_none is False:
+            raise ValueError(f"Cannot set 'skip_none' to False on a 
{type(self)}")
+
+        if not self.value or not self.value.tags:
+            return select
+
+        conditions = [DagModel.tags.any(DagTag.name == tag) for tag in 
self.value.tags]
+        return select.where(*conditions, DagRun.dag_id == DagModel.dag_id )
+
+    @classmethod
+    def depends(
+        cls,
+        tags: list[str] = Query(default_factory=list)
+    ) -> _DagTagsFilter:
+        return cls().set_value(_DagTagFilterModel(tags=tags))
+
+    

Review Comment:
   yes, will reuse _TagFilterModel and _TagsFilter @pierrejeambrun 



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