Skip to content

chore(django-google-spanner): unconditionally quote all identifiers in quote_name #19072

Open

Description

@olavloite

Follow-up to #19069.

Once prerequisite schema.py fixes are in place, DatabaseOperations.quote_name() should unconditionally quote all identifiers instead of leaving unreserved regular ASCII identifiers unquoted (so reserved-keyword tracking via SPANNER_RESERVED_KEYWORDS is no longer needed).

Tasks

  • Fix OpenTelemetry model_name span attributes in django_spanner/schema.py to pass unquoted model._meta.db_table instead of calling self.quote_name(...).
  • Ensure check-constraint DDL quoting (fix(django-google-spanner): fix column check constraint DDL #19070) is merged.
  • Update unit tests expecting unquoted unreserved identifiers.
  • Remove the _REGULAR_IDENTIFIER_RE / SPANNER_RESERVED_KEYWORDS fast-path in DatabaseOperations.quote_name().

Activity

  1. added
    api: spanner
    on Nov 13, 2026
  2. PCTEJA commented on Nov 26, 2026

    @PCTEJA

    I opened #19228 for this.

    It removes the regular identifier fast path in quote_name() so all identifiers are quoted, and drops the SPANNER_RESERVED_KEYWORDS import and _REGULAR_IDENTIFIER_RE. The model_name span attributes in schema.py already pass the unquoted db_table, so no change was needed there.

    Unit and mockserver tests pass on Django 5.2 and 6.0 (223 tests), with the updated expectations failing on the previous implementation.

  3. PCTEJA commented on Nov 26, 2026

    @PCTEJA

    @olavloite, could you please review #19228 when you are free? Thank you!

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

    api: spanner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions