Skip to content

v0.20.0

Choose a tag to compare

@github-actions github-actions released this 05 Sep 14:47
· 6 commits to main since this release
3c4f470

Added

  • A lone % in a sql= statement is refused at declaration time. The
    statement is run with its parameters, and an empty parameter sequence is still
    a sequence, so a % that is not a placeholder is read as the start of one:
    the failure came from psycopg/cursor.py at build time, naming the driver and
    nothing about the shape. A caller who passed no parameters at all had no model
    that explained it, and the modulo operator is the reason anyone writes a bare
    % in the first place.

    A valid statement can never contain one, so nothing legal is refused -- which
    is the whole reason this can be a refusal rather than an escape. sql= takes
    params=, so pyformat is its interface and %% stays the spelling for the
    operator.

    SqlValue on the derived path escapes instead, and the two are not
    inconsistent: there the caller supplies no parameters and has no reason to
    know one exists. Both docstrings and the projections guide now say which is
    which, at both call sites, because the asymmetry is exactly what a reader
    finding one of them will next be confused by.