Skip to content

Bug: ValueError in clean_duplicate_history commandΒ #1480

@niksite

Description

@niksite

Description:

The clean_duplicate_history management command raises a ValueError when used with Django 5.1 and a PostgreSQL DB backend. This error occurs if QuerySet.iterator() is called after prefetch_related() without specifying a chunk_size.

Error:

ValueError: chunk_size must be provided when using QuerySet.iterator() after prefetch_related().

Location:

The error originates in the _process method within simple_history/management/commands/clean_duplicate_history.py.

Proposed Fix:

Specify a chunk_size when calling .iterator() on QuerySets that use prefetch_related().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions