fire-eggs / Danbooru2021

Python scripts and tools for working with the Danbooru2022 data set. Note: this is a sqlite database and a viewer, not directly related to machine learning.
https://www.gwern.net/Danbooru2021
MIT License
42 stars 2 forks source link

partially populated FilterView causes crash #47

Open fire-eggs opened 2 years ago

fire-eggs commented 2 years ago

Inadvertently set up my FilterView as follows:

     touhou
AND
AND  translated

Crashed.

fire-eggs commented 2 months ago
    touhou

AND translated

(note the middle entry is fully empty)

select image_id from images where is_deleted=0 and is_banned=0 and image_id in (select image_id from imageTags where tag_id in (select tag_id from tags where name like ?) INTERSECT select image_id from imageTags where tag_id in (select tag_id from tags where name like ?)) order by image_id
('touhou',)
Exception ignored in thread started by: <function producer at 0x7f37b51811b0>
Traceback (most recent call last):
  File "/home/kevin/db2020/db2024_meta/browser/./tagview.py", line 291, in producer
    image_ids = DanbooruDB().getImagesForTags2(postsFilter.TagFilter1(), \
  File "/home/kevin/db2020/db2024_meta/browser/danboorudb.py", line 169, in getImagesForTags2
    self.cur.execute(full,params)
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 2, and there are 1 supplied.