Skip to content

fix(django-google-spanner): JSONField key-transform equality lookup fails on Spanner #19088

Open

Description

@olavloite

Summary

tests/system/django_spanner/test_json_field.py::TestJsonField::test_insert_and_fetch_value fails when executed against the Spanner Emulator on both Django 5.2 and Django 6.0.

Failure Details

Detail.objects.filter(value__name="Jakob") (line 49 of packages/django-google-spanner/tests/system/django_spanner/test_json_field.py) generates:

SELECT tests_detail.id, tests_detail.value FROM tests_detail WHERE JSON_QUERY(tests_detail.value, '$."name"') = %s

with parameter (_JsonString('"Jakob"'),) (param_types: JSON).

Spanner rejects this query with:

google.api_core.exceptions.InvalidArgument: 400 Equality is not defined for arguments of type JSON

because GoogleSQL does not support = comparisons between JSON values.

Context

This test was updated in PR #19007, which was not caught at the time because tests/system/ was not being run against the emulator in CI. While enabling tests/system/ on the emulator in GitHub Actions, TestJsonField.test_insert_and_fetch_value is temporarily skipped with a TODO referencing this issue.

Activity

  1. added
    type: bug
    api: spanner
    on Nov 14, 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

    api: spannertype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions