File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -613,18 +613,17 @@ async def test_sparsevec(self, engine):
613
613
614
614
@pytest .mark .asyncio
615
615
async def test_avg (self , engine ):
616
- # TODO do not throw error when types are registered
617
- if engine == psycopg_async_type_engine :
618
- return
619
-
620
616
async_session = async_sessionmaker (engine , expire_on_commit = False )
621
617
622
618
async with async_session () as session :
623
619
async with session .begin ():
624
620
session .add (Item (embedding = [1 , 2 , 3 ]))
625
621
session .add (Item (embedding = [4 , 5 , 6 ]))
626
622
avg = await session .scalars (select (func .avg (Item .embedding )))
627
- assert avg .first () == '[2.5,3.5,4.5]'
623
+ if engine == psycopg_async_type_engine :
624
+ assert avg .first ().tolist () == [2.5 , 3.5 , 4.5 ]
625
+ else :
626
+ assert avg .first () == '[2.5,3.5,4.5]'
628
627
629
628
await engine .dispose ()
630
629
You can’t perform that action at this time.
0 commit comments