You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2026/01/05 04:58:41 UTC

[PR] Re-apply PriorityWeightStrategy SDK work [airflow]

uranusjr opened a new pull request, #60112:
URL: https://github.com/apache/airflow/pull/60112

   This re-applies #59780 (by reverting #59828) with additional fixes.
   
   Not ready yet; depends on #59922.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Re-apply PriorityWeightStrategy SDK work [airflow]

Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #60112:
URL: https://github.com/apache/airflow/pull/60112#discussion_r2663756695


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -372,45 +372,52 @@
 
     This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs.
     """
-    query = select(DagRun).options(*eager_load_dag_run_for_validation())
+    try:
+        query = select(DagRun).options(*eager_load_dag_run_for_validation())
+
+        if dag_id != "~":
+            get_latest_version_of_dag(dag_bag, dag_id, session)  # Check if the DAG exists.
+            query = query.filter(DagRun.dag_id == dag_id).options()
+
+        # Add join with DagVersion if dag_version filter is active
+        if dag_version.value:
+            query = query.join(DagVersion, DagRun.created_dag_version_id == DagVersion.id)
+
+        dag_run_select, total_entries = paginated_select(
+            statement=query,
+            filters=[
+                run_after,
+                logical_date,
+                start_date_range,
+                end_date_range,
+                update_at_range,
+                duration_range,
+                conf_contains,
+                state,
+                run_type,
+                dag_version,
+                readable_dag_runs_filter,
+                run_id_pattern,
+                triggering_user_name_pattern,
+                dag_id_pattern,
+            ],
+            order_by=order_by,
+            offset=offset,
+            limit=limit,
+            session=session,
+        )
+        dag_runs = session.scalars(dag_run_select)
 
-    if dag_id != "~":
-        get_latest_version_of_dag(dag_bag, dag_id, session)  # Check if the DAG exists.
-        query = query.filter(DagRun.dag_id == dag_id).options()
+        return DAGRunCollectionResponse(
+            dag_runs=dag_runs,
+            total_entries=total_entries,
+        )
+    except Exception:
+        import traceback
 
-    # Add join with DagVersion if dag_version filter is active
-    if dag_version.value:
-        query = query.join(DagVersion, DagRun.created_dag_version_id == DagVersion.id)
+        from fastapi.responses import Response
 
-    dag_run_select, total_entries = paginated_select(
-        statement=query,
-        filters=[
-            run_after,
-            logical_date,
-            start_date_range,
-            end_date_range,
-            update_at_range,
-            duration_range,
-            conf_contains,
-            state,
-            run_type,
-            dag_version,
-            readable_dag_runs_filter,
-            run_id_pattern,
-            triggering_user_name_pattern,
-            dag_id_pattern,
-        ],
-        order_by=order_by,
-        offset=offset,
-        limit=limit,
-        session=session,
-    )
-    dag_runs = session.scalars(dag_run_select)
-
-    return DAGRunCollectionResponse(
-        dag_runs=dag_runs,
-        total_entries=total_entries,
-    )
+        return Response(status_code=500, content=traceback.format_exc())

Review Comment:
   ## Information exposure through an exception
   
   [Stack trace information](1) flows to this location and may be exposed to an external user.
   
   [Show more details](https://github.com/apache/airflow/security/code-scanning/562)



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Re-apply PriorityWeightStrategy SDK work [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr merged PR #60112:
URL: https://github.com/apache/airflow/pull/60112


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Re-apply PriorityWeightStrategy SDK work [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #60112:
URL: https://github.com/apache/airflow/pull/60112#issuecomment-3709146684

   This is so much easier after the massive cleanup!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Re-apply PriorityWeightStrategy SDK work [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #60112:
URL: https://github.com/apache/airflow/pull/60112#discussion_r2664417574


##########
airflow-core/newsfragments/59780.significant.rst:
##########
@@ -0,0 +1,9 @@
+Methods removed from PriorityWeightStrategy and TaskInstance
+
+On (expreimental) class ``PriorityWeightStrategy``, functions ``serialize()``

Review Comment:
   ```suggestion
   On (experimental) class ``PriorityWeightStrategy``, functions ``serialize()``
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org