-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make query callables work again
Passing a callable as a query used to work but got broken in v4.6.0 due to the necessity of having to distinguish between cacheable and non-cacheable queries. This was implemented using a new method named `is_cacheable` that was expected to be present on every query object -- which of course is not the case for custom queries that are implemented by passing a callable as a query. We now only try to call `is_cacheable` if this method is present on a query object. If it is NOT present, we treat it as cacheable. This is to keep consistency with TinyDB's earlier behavior which assumed that all queries are cacheable. Fixes #454
- Loading branch information
Showing
3 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters