AnswerDotAI / fastlite

A bit of extra usability for sqlite
https://answerdotai.github.io/fastlite/
Apache License 2.0
174 stars 14 forks source link

Fix `__contains__` on tuple pk searches #20

Closed pydanny closed 3 months ago

pydanny commented 3 months ago

As lists cannot be added to tuples and vice-versa, we cast pk_values to a list.

Python 3.10.6 (main, Dec 12 2023, 14:13:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [] + ()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "tuple") to list
>>> () + []
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only concatenate tuple (not "list") to tuple
jph00 commented 3 months ago

Thank you!