Skip to content
New issue

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

Removed sqlalchemy-filters #3317

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions db/records/operations/relevance.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down