Skip to content

Preflight batch-size limits on mutations (#555 P2) #558

@axisrow

Description

@axisrow

Split out from #555 as the P2 scope (mutation batch limits), so the P0 array-length preflight (#555 PR) could ship verified-live without bundling unverified mutation caps.

Scope

Add preflight size/empty-ID checks to mutating commands that currently forward arrays / single IDs to the API with no size or empty-ID validation:

  • keywords update
  • ads add / ads update
  • adgroups add / adgroups update
  • the lifecycle commands built by direct_cli/commands/_lifecycle.py

Why separate from P0

The P0 array-length limits on get (keywordbids/dynamicads/smartadtargets) were measured live against the v5 API (#555 PR — merged). The mutation batch limits here are not yet verified live and need their own measurement pass (bump each batch by one past the suspected ceiling, read the exact 4001/per-item error, pin a constant with a doc/live citation — same discipline as KEYWORDS_ADD_MAX_BATCH and the new *_GET_CRITERIA_LIMITS constants).

Not in scope

Approach

Reuse direct_cli/utils.py::enforce_criteria_array_limits (added in the #555 P0 PR) where the mutation also builds a SelectionCriteria, and follow the keywords.py _warn_on_adgroup_overflow / _chunked precedent for true batch endpoints. TDD + live verification per command.

Refs #555

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions