Lee-W commented on code in PR #37176:
URL: https://github.com/apache/airflow/pull/37176#discussion_r1481112633


##########
airflow/api_connexion/endpoints/dataset_endpoint.py:
##########
@@ -124,3 +129,148 @@ def get_dataset_events(
     return dataset_event_collection_schema.dump(
         DatasetEventCollection(dataset_events=events, 
total_entries=total_entries)
     )
+
+
+def _get_ddrq(dag_id: str, uri: str, session: Session, before: str | None = 
None) -> DatasetDagRunQueue:
+    """Get DatasetDagRunQueue."""
+    dataset = session.scalar(select(DatasetModel).where(DatasetModel.uri == 
uri))
+    if not dataset:
+        return None
+    dataset_id = dataset.id
+
+    where_clause_conditions = [
+        DatasetDagRunQueue.target_dag_id == dag_id,
+        DatasetDagRunQueue.dataset_id == dataset_id,
+    ]
+    if before is not None:
+        where_clause_conditions.append(DatasetDagRunQueue.created_at < 
format_datetime(before))
+
+    return 
session.scalar(select(DatasetDagRunQueue).where(*where_clause_conditions))

Review Comment:
   Sure. just rewrite it in the latest version



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