From 24737c7559cf089ff352baaf192e05e32b97a52f Mon Sep 17 00:00:00 2001 From: Aniket Singh Rawat Date: Tue, 21 Nov 2023 23:10:27 +0530 Subject: [PATCH] Removed sqlalchemy-filters --- db/records/operations/relevance.py | 8 ++------ requirements.txt | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/db/records/operations/relevance.py b/db/records/operations/relevance.py index bd804495f2..056f65eaac 100644 --- a/db/records/operations/relevance.py +++ b/db/records/operations/relevance.py @@ -1,5 +1,4 @@ -from sqlalchemy import case, select -from sqlalchemy_filters import apply_sort +from sqlalchemy import case, select, desc from db.types import categories from db.types.operations.convert import get_db_type_enum_from_class @@ -18,10 +17,7 @@ def get_rank_and_filter_rows_query(relation, parameters_dict, limit=10): parameters given in parameters_dict. """ rank_cte = _get_scored_selectable(relation, parameters_dict) - filtered_ordered_cte = apply_sort( - select(rank_cte).where(rank_cte.columns[SCORE_COL] > 0), - {'field': SCORE_COL, 'direction': 'desc'} - ).cte() + filtered_ordered_cte = select(rank_cte).where(rank_cte.columns[SCORE_COL] > 0).order_by(desc(SCORE_COL)).cte() return select( *[filtered_ordered_cte.columns[c] for c in [col.name for col in relation.columns]] ).limit(limit) diff --git a/requirements.txt b/requirements.txt index cb22ac0384..e4498bca68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,6 @@ responses==0.22.0 SQLAlchemy-Utils==0.38.2 thefuzz==0.19.0 whitenoise==6.4.0 -git+https://github.com/mathesar-foundation/sqlalchemy-filters@models_to_tables#egg=sqlalchemy_filters gunicorn==20.1.0 drf-spectacular==0.26.2 pandas==2.0.2