Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

Incompatible with google-cloud-spanner 3.12 ->> UserWarning: The rowcount property is non-operational | Cannot update/delete model objects #740

@rajjagesar

Description

@rajjagesar

Environment details

  • Programming language: Python
  • OS: MacOS Big Sur 11.4
  • Language runtime version: 3.8.9
  • Package version: Django 3.2.2 and 3.2.9 with django-cloud-spanner 3.0.0 and google-cloud spanner 3.12.0

Steps to reproduce

  1. Follow the "from scratch" documentation as outlined in the readme to the letter
  2. Instantiate and save a model, e.g.: a = MyModel.objects.create(name="testname")
  3. Try to delete the model with: a.delete()
  4. This will trigger the following error:
/Users/me/.pyenv/versions/3.8.9/envs/spannertest/lib/python3.8/site-packages/django/db/backends/utils.py:22: UserWarning: The `rowcount` property is non-operational. Request resulting rows are streamed by the `fetch*()` methods and can't be counted before they are all streamed.
cursor_attr = getattr(self.cursor, attr)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/me/.pyenv/versions/3.8.9/envs/spannertest/lib/python3.8/site-packages/django/db/models/base.py", line 954, in delete
  return collector.delete()
File "/Users/me/.pyenv/versions/3.8.9/envs/spannertest/lib/python3.8/site-packages/django/db/models/deletion.py", line 396, in delete
  count = sql.DeleteQuery(model).delete_batch([instance.pk], self.using)
File "/Users/me/.pyenv/versions/3.8.9/envs/spannertest/lib/python3.8/site-packages/django/db/models/sql/subqueries.py", line 43, in delete_batch
  num_deleted += self.do_query(self.get_meta().db_table, self.where, using=using)
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

A similar error will be raised when trying to update the model: a.name = "new name" & a.save().

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-django API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions