chore: Consistent use of apaginate and update fastapi-pagination version (#8037)
* chore: update fastapi-pagination dependency version to 0.13.1 in project files * fix: replace paginate with apaginate in flow, monitor, and project modules for consistency
This commit is contained in:
parent
58522ee2ab
commit
90226d3012
4 changed files with 6 additions and 6 deletions
|
|
@ -15,7 +15,7 @@ from fastapi import APIRouter, Depends, File, HTTPException, Response, UploadFil
|
||||||
from fastapi.encoders import jsonable_encoder
|
from fastapi.encoders import jsonable_encoder
|
||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
from fastapi_pagination import Page, Params
|
from fastapi_pagination import Page, Params
|
||||||
from fastapi_pagination.ext.sqlalchemy import paginate
|
from fastapi_pagination.ext.sqlalchemy import apaginate
|
||||||
from sqlmodel import and_, col, select
|
from sqlmodel import and_, col, select
|
||||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||||
|
|
||||||
|
|
@ -247,7 +247,7 @@ async def read_flows(
|
||||||
return compress_response(flows)
|
return compress_response(flows)
|
||||||
|
|
||||||
stmt = stmt.where(Flow.folder_id == folder_id)
|
stmt = stmt.where(Flow.folder_id == folder_id)
|
||||||
return await paginate(session, stmt, params=params)
|
return await apaginate(session, stmt, params=params)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from uuid import UUID
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query
|
from fastapi import APIRouter, Depends, HTTPException, Query
|
||||||
from fastapi_pagination import Page, Params
|
from fastapi_pagination import Page, Params
|
||||||
from fastapi_pagination.ext.sqlmodel import paginate
|
from fastapi_pagination.ext.sqlmodel import apaginate
|
||||||
from sqlalchemy import delete
|
from sqlalchemy import delete
|
||||||
from sqlmodel import col, select
|
from sqlmodel import col, select
|
||||||
|
|
||||||
|
|
@ -171,6 +171,6 @@ async def get_transactions(
|
||||||
.where(TransactionTable.flow_id == flow_id)
|
.where(TransactionTable.flow_id == flow_id)
|
||||||
.order_by(col(TransactionTable.timestamp))
|
.order_by(col(TransactionTable.timestamp))
|
||||||
)
|
)
|
||||||
return await paginate(session, stmt, params=params, transformer=transform_transaction_table)
|
return await apaginate(session, stmt, params=params, transformer=transform_transaction_table)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ dependencies = [
|
||||||
"diskcache>=5.6.3,<6.0.0",
|
"diskcache>=5.6.3,<6.0.0",
|
||||||
"clickhouse-connect==0.7.19",
|
"clickhouse-connect==0.7.19",
|
||||||
"assemblyai>=0.33.0,<1.0.0",
|
"assemblyai>=0.33.0,<1.0.0",
|
||||||
"fastapi-pagination>=0.12.29,<1.0.0",
|
"fastapi-pagination>=0.13.1,<1.0.0",
|
||||||
"defusedxml>=0.7.1,<1.0.0",
|
"defusedxml>=0.7.1,<1.0.0",
|
||||||
"pypdf~=5.1.0",
|
"pypdf~=5.1.0",
|
||||||
"validators>=0.34.0",
|
"validators>=0.34.0",
|
||||||
|
|
|
||||||
2
uv.lock
generated
2
uv.lock
generated
|
|
@ -5146,7 +5146,7 @@ requires-dist = [
|
||||||
{ name = "elevenlabs", specifier = ">=1.54.0" },
|
{ name = "elevenlabs", specifier = ">=1.54.0" },
|
||||||
{ name = "emoji", specifier = ">=2.12.0,<3.0.0" },
|
{ name = "emoji", specifier = ">=2.12.0,<3.0.0" },
|
||||||
{ name = "fastapi", specifier = ">=0.115.2,<1.0.0" },
|
{ name = "fastapi", specifier = ">=0.115.2,<1.0.0" },
|
||||||
{ name = "fastapi-pagination", specifier = ">=0.12.29,<1.0.0" },
|
{ name = "fastapi-pagination", specifier = ">=0.13.1,<1.0.0" },
|
||||||
{ name = "filelock", specifier = ">=3.15.4,<4.0.0" },
|
{ name = "filelock", specifier = ">=3.15.4,<4.0.0" },
|
||||||
{ name = "firecrawl-py", specifier = ">=1.0.16,<2.0.0" },
|
{ name = "firecrawl-py", specifier = ">=1.0.16,<2.0.0" },
|
||||||
{ name = "flower", marker = "extra == 'all'", specifier = ">=1.0.0" },
|
{ name = "flower", marker = "extra == 'all'", specifier = ">=1.0.0" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue