Closed wiseaidev closed 2 years ago
Code to reproduce the issue:
from typing import Optional, Any from fastapi import FastAPI from pydantic import BaseModel, Field as PydanticField, EmailStr import datetime from aredis_om import ( Field, HashModel, Migrator, get_redis_connection ) redis_conn = get_redis_connection( url=f"redis://localhost:6379", decode_responses=True ) class User(HashModel): first_name: Optional[str] = Field(index=True) last_name: Optional[str] = Field(index=True) email: EmailStr = Field(index=True) password: str = Field(index=True) created_on: Optional[datetime.datetime] = Field(default_factory=datetime.datetime.now) class Meta: database = redis_conn router = FastAPI(title=__name__) @router.on_event("startup") async def startup(): await Migrator().run() user2 = await User(email="yo@wiseai.dev", password="P@ssW0rD").save() await User.find(User.email=="yo@wiseai.dev").delete() await User.find(User.email=="yo@wiseai.dev").delete()
Output:
raise response from None aioredis.exceptions.ResponseError: wrong number of arguments for 'del' command
Great catch! thanks for reporting this. I opened a PR to fix it #372
Code to reproduce the issue:
Output: