Skip to content

A % in a table or attribute comment fails to declare; %% is stored as % #1789

Backlog

Description

@dimitri-yatsenko

Description

A % in a table or attribute comment makes the table fail to declare, on both backends. A %% declares, but is stored as a single %. The declared DDL goes through the driver's parameter formatting even though no parameters are passed, so % is read as a format placeholder.

Found by @MilagrosMarin while reviewing #1754. It happens on master too.

Reproduction

@schema
class T(dj.Manual):
    definition = """
    # table 50% done
    x : int32  # col 50% done
    """
  • MySQL (PyMySQL): ProgrammingError: not enough arguments for format string
  • PostgreSQL (psycopg2): IndexError: tuple index out of range

With literal %% kept in both comments, the table declares, and both comments read back as literal % kept.

Expected

Comments containing % declare and are stored as written. For example, % could be escaped where the DDL is built, or DDL could be sent without parameter formatting.

Activity

  1. added this to the v2.4 milestone on Dec 2, 2026
  2. added
    bug
    on Dec 2, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions