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

feat: adds search query for /keys #263

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kirtanchandak
Copy link
Contributor

What

Adds search query /?q=col for searching is /keys endpoint.

Screenshot

image

Fixes bug(s)

#19

@kirtanchandak kirtanchandak requested a review from a team as a code owner March 18, 2025 17:58
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.61%. Comparing base (b9cda65) to head (056d1e9).
Report is 82 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
- Coverage   95.06%   94.61%   -0.45%     
==========================================
  Files           5        5              
  Lines         324      390      +66     
==========================================
+ Hits          308      369      +61     
- Misses         16       21       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CharlesNepote
Copy link
Member

At least you should also update tests in test_main.py: I think you can create a new one.

"""
query_params = [owner]

if q:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you make it more readable like, this for example:

{f"AND k IN ({placeholders})" if keys_list else ""}

Having the all the query in one block can be easier to read and debug I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I have also done the same as you here:

but I'm still learning Python 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made it more readable and added tests too

'values',count(distinct(v))
) as j
'k', k,
'count', count(*),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'count', count(*),
'count', COUNT(*),

) as j
'k', k,
'count', count(*),
'values', count(distinct v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'values', count(distinct v)
'values', COUNT(distinct v)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants