Skip to content

Validate map_index range when creating task instances via CLI #60463

Closed

Description

@Vamsi-klu

Split from PR #60435.

In airflow-core/src/airflow/cli/commands/task_command.py, _get_ti has a TODO to validate map_index is in range when creating a mapped task instance.

  • TODO: # TODO: Validate map_index is in range?
  • Context: _get_ti only checks map_index presence, but doesn't validate against parse-time mapped count when available.

Proposal:

  • If map_index >= 0 and the task has a parse-time mapped count, raise a clear error when out of range.
  • Skip validation when the count is not known (e.g. XCom-driven mapping).

Activity

  1. boring-cyborg commented on Jan 13, 2026

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  2. added
    kind:bug
    on Jan 13, 2026
  3. added a commit that references this issue on Mar 11, 2026
    80f29ca
  4. added a commit that references this issue on Mar 11, 2026
    a6ea6f9
  5. added a commit that references this issue on Mar 11, 2026
    4d477fa
  6. added a commit that references this issue on Mar 13, 2026
    9d4a65a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:CLIkind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions