Skip to content

Calculate Field counts selected rows the layer no longer has in its notices #2838

Backlog

Description

@jgregoriorincon

calculate_field (crates/engine/src/cmd/edit.rs:1597) passes every selected index to evaluate, including ones past the layer's end. Nothing is written to them (original.get(r) at edit.rs:1604), but losses.write counts them: they read as null, so a notice can say "is null in N rows" or list a division by zero for a row that doesn't exist, and {"rows": n} counts them too. Filtering the selection to existing rows fixes both; the rows answer would then change for callers (CLI, Python, MCP). The preview already skips such rows (#2822).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions