Skip to content

[v3-2-test] Fix TypeError in GET /dags/{dag_id}/tasks when order_by field has None values (#64384)#64587

Draft
github-actions[bot] wants to merge 1 commit intov3-2-testfrom
backport-15cf396-v3-2-test
Draft

[v3-2-test] Fix TypeError in GET /dags/{dag_id}/tasks when order_by field has None values (#64384)#64587
github-actions[bot] wants to merge 1 commit intov3-2-testfrom
backport-15cf396-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown

@github-actions github-actions bot commented Apr 1, 2026

The tasks endpoint crashed with a 500 Internal Server Error when sorting
by a field (e.g. start_date) that contains None values, because Python 3
cannot compare None with None using '<'.

This adds explicit validation of the order_by parameter against a
whitelist of sortable fields (returning 400 for invalid fields, consistent
with SortParam used in other endpoints) and handles None values in the
sort key so nullable fields work correctly.

Closes: #63927
(cherry picked from commit 15cf396)

Co-authored-by: Antonio Mello ajgcvm@gmail.com
Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com

…ield has None values (#64384)

The tasks endpoint crashed with a 500 Internal Server Error when sorting
by a field (e.g. start_date) that contains None values, because Python 3
cannot compare None with None using '<'.

This adds explicit validation of the order_by parameter against a
whitelist of sortable fields (returning 400 for invalid fields, consistent
with SortParam used in other endpoints) and handles None values in the
sort key so nullable fields work correctly.

Closes: #63927
(cherry picked from commit 15cf396)

Co-authored-by: Antonio Mello <ajgcvm@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant