We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When doing a .select(ids=[...]), for an _id that does not exist, one would expect an empty list rather than None
.select(ids=[...])
_id
None
To Reproduce
import uuid from typing import Optional from pydantic import Field from pydantic_redis import Store, RedisConfig, Model class SomeModel(Model): _primary_key_field = "id" id: str = Field( default_factory=lambda: uuid.uuid4().hex, ) name: str = Field() store = Store( name="none should return a list too", redis_config=RedisConfig(host='localhost', port=6379, db=6) ) store.register_model(SomeModel) parent = SomeModel(name="bong bing") SomeModel.insert(parent) models_received = SomeModel.select(ids=["some none existing id"]) print(models_received) assert isinstance(models_received, list)
Expected behavior One would expect this assertion to pass. Instead, we get:
assert isinstance(models_received, list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError None
The text was updated successfully, but these errors were encountered:
If columns is specified, the select method does return an empty list
columns
select
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When doing a
.select(ids=[...])
, for an_id
that does not exist, one would expect an empty list rather thanNone
To Reproduce
Expected behavior
One would expect this assertion to pass. Instead, we get:
The text was updated successfully, but these errors were encountered: