antonio-mello-ai opened a new pull request, #64384:
URL: https://github.com/apache/airflow/pull/64384
Fix TypeError in `GET /dags/{dag_id}/tasks` when sorting by a field whose
values
can be `None` (e.g. `start_date` on unscheduled DAGs). Previously this
caused a
500 Internal Server Error because Python 3 cannot compare `None` with `None`.
**Changes:**
- Add `_SORTABLE_TASK_FIELDS` whitelist to validate `order_by` upfront,
returning
400 for invalid fields (consistent with `SortParam` error format used in
other endpoints)
- Handle `None` values in the sort key so nullable fields sort correctly
(tasks with `None` values are placed at the end)
closes: #63927
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude (Anthropic)
Generated-by: Claude following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
* Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
--
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]