Skip to content

.delete_where() returns [] when it should return self #315

@simonw

Description

@simonw

If the table doesn't exist it should still return self, not []:

def delete_where(self, where=None, where_args=None):
if not self.exists():
return []
sql = "delete from [{}]".format(self.name)
if where is not None:
sql += " where " + where
self.db.execute(sql, where_args or [])
return self

Spotted with mypy while working on #312.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions