Skip to content

Remove obsolete AIP-76 partition-date storage TODOs#68703

Open
Lee-W wants to merge 5 commits into
apache:mainfrom
astronomer:remove-stale-aip76-todos
Open

Remove obsolete AIP-76 partition-date storage TODOs#68703
Lee-W wants to merge 5 commits into
apache:mainfrom
astronomer:remove-stale-aip76-todos

Conversation

@Lee-W

@Lee-W Lee-W commented Jun 18, 2026

Copy link
Copy Markdown
Member

Why

AIP-76 (Asset Partitions) left a scattering of # todo: AIP-76 notes, but most are no longer actionable: some describe behavior that has since changed, some are open-ended design musings, and some restate an accepted limitation. Comments that read like a TODO but cannot be acted on rot — they mislead readers into thinking there is pending work.

What

No behavior change — this is comment cleanup plus one added test.

  • Remove obsolete partition-date storage TODOs. The "we can't infer the partition date from this, so we need to store it separately" note predates the next_dagrun_partition_date / next_dagrun_partition_key columns and DagRunInfo.partition_date / partition_key. The partition date is now stored independently and no longer back-derived from the key format, so the note no longer matches the code (core + SDK, 3 sites).
  • Remove speculative design-question comments. Open-ended musings ("we could…", "perhaps we need…", "unclear whether we should…") in trigger.py, dag.py, and the scheduler are not actionable items; they read as a parked idea list rather than work.
  • Demote limitation caveats from TODO to plain comments. Two notes describe already-accepted behaviour (run-date→partition is lossy for some offsets; runs with a null logical_date are not matched). They are rewritten as neutral comments that keep the caveat without implying pending work.
  • Remove untracked forward-looking TODOs. The auto-reprocessing note was only a discussion starter with no tracking issue; the run_offset timedelta / relativedelta note duplicated the adjacent guard that already raises "not supported yet".
  • Cover CronPartitionTimetable.next_dagrun_info_v2 branches with tests. The existing db-backed test only exercised the catch-up + no-previous-run branch. A direct unit test now covers the rest (catching up advancing from a previous run, first run with no earliest, non-catchup candidate selection, the earliest lower bound, and the latest upper bound returning None), letting the "add test for this logic" TODO go.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Claude] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:Scheduler including HA (high availability) scheduler area:task-sdk labels Jun 18, 2026
Lee-W added 5 commits June 18, 2026 21:05
These TODOs predate the dedicated next_dagrun_partition_date /
next_dagrun_partition_key columns and the partition_date / partition_key
fields on DagRunInfo. Partition date is now stored separately rather than
re-derived from key_format, so the comments no longer describe the code.
The existing db-backed test only exercised the catchup path with no prior
run. Add a direct unit test over the remaining branches — catchup advancing
from a last run, the no-earliest first-run path, the non-catchup candidate
selection, the earliest floor, and the latest cutoff returning None — and
drop the "add test for this logic" TODO now that it is covered.
These comments posed open design questions ("we could…", "perhaps we
need…", "unclear whether we should / need to") rather than marking
concrete pending work, so they read as TODOs without being actionable.
Drop them to avoid a standing punch-list of undecided ideas in the
source; the kept TODOs remain those that document a limitation at its
enforcing site or link a tracked issue.
These two comments describe accepted current behaviour — the run-date to
partition mapping being lossy for some offsets, and null-logical_date runs
not being matched — rather than pending work. Rewording them as neutral
comments keeps the caveat without implying a standing TODO.
The auto-reprocessing note was a discussion prompt with no tracked issue,
and the run_offset timedelta/relativedelta note was redundant with the
adjacent guard that already raises "not supported yet". Neither marked
actionable, tracked work, so drop both. The remaining AIP-76 TODO links
issue apache#59618.
@Lee-W Lee-W force-pushed the remove-stale-aip76-todos branch from 61fd017 to 5fd08f4 Compare June 18, 2026 13:05
@Lee-W Lee-W added the backport-to-v3-3-test Backport to v3-3-test label Jun 18, 2026
@Lee-W Lee-W marked this pull request as ready for review June 18, 2026 13:14
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 area:Scheduler including HA (high availability) scheduler area:task-sdk backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant