Skip to content

Fix cursor encoding for column-form SortParam to_replace#67973

Open
GayathriSrividya wants to merge 2 commits into
apache:mainfrom
GayathriSrividya:fix/ti-cursor-run-after-67970
Open

Fix cursor encoding for column-form SortParam to_replace#67973
GayathriSrividya wants to merge 2 commits into
apache:mainfrom
GayathriSrividya:fix/ti-cursor-run-after-67970

Conversation

@GayathriSrividya

Copy link
Copy Markdown
Contributor

closes #67970

Summary

  • update SortParam.row_value to fall back to getattr(row, name) when to_replace uses column-form mappings
  • keep existing string-alias behavior unchanged
  • add regression coverage in common parameter and cursor tests

Why

Task Instances sorting by run_after/logical_date/data_interval_* uses column-form to_replace mappings. Cursor encoding previously raised NotImplementedError when has_next=true, causing HTTP 500.

Validation

  • /opt/homebrew/bin/ruff format + check --fix on touched files passed
  • pytest execution is currently blocked in this environment by missing provider dependency: airflow.providers.openlineage (fails before tests run)

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down and following the issue's analysis — the run_after 500 is real and this is close.

One thing I'd change before merge: returning getattr(row, name, None) for column-form to_replace fixes run_after/logical_date (those are association_proxy on TaskInstance), but data_interval_start/data_interval_end aren't attributes on TaskInstance, so they resolve to None. A None cursor value becomes the pagination anchor, so the next-page WHERE compares against NULL, matches nothing, and the next page comes back empty with a 200 — arguably worse than the current 500, since it silently drops rows instead of erroring. The original NotImplementedError was guarding exactly this.

Could we keep the loud failure for keys the model doesn't expose, while resolving the ones it does (see the inline suggestion)? Also looks like it needs a rebase — it's currently conflicting with main.

Comment thread airflow-core/src/airflow/api_fastapi/common/parameters.py Outdated
Comment thread airflow-core/tests/unit/api_fastapi/common/test_parameters.py
@potiuk

potiuk commented Jun 9, 2026

Copy link
Copy Markdown
Member

@GayathriSrividya A few things need addressing before review — see our Pull Request quality criteria.

  • Merge conflicts with main. See docs.

No rush.

Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

@GayathriSrividya GayathriSrividya force-pushed the fix/ti-cursor-run-after-67970 branch 2 times, most recently from ef4fc13 to 9c26850 Compare June 10, 2026 06:16
@GayathriSrividya GayathriSrividya force-pushed the fix/ti-cursor-run-after-67970 branch 2 times, most recently from 7ab6f8a to 8d94ea7 Compare June 10, 2026 06:22
@GayathriSrividya

Copy link
Copy Markdown
Contributor Author

@GayathriSrividya A few things need addressing before review — see our Pull Request quality criteria.

  • Merge conflicts with main. See docs.

No rush.

Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiuk Resolved — rebased on latest main, all reviewer suggestions applied.

@GayathriSrividya GayathriSrividya force-pushed the fix/ti-cursor-run-after-67970 branch 3 times, most recently from 3b80ece to e4f2159 Compare June 10, 2026 10:34

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

CI need fixing. (we'r missing an import on dag_maker)

@GayathriSrividya GayathriSrividya force-pushed the fix/ti-cursor-run-after-67970 branch from e4f2159 to 061ebcd Compare June 10, 2026 16:29
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.

HTTP 500 on GET /api/v2/dags//dagRuns//taskInstances after sorting by run_after column (regression in 3.2.2)

3 participants