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: add group_by to fetch_page #2140

Merged
merged 15 commits into from
Mar 12, 2024
Merged

feat: add group_by to fetch_page #2140

merged 15 commits into from
Mar 12, 2024

Conversation

dni
Copy link
Member

@dni dni commented Nov 30, 2023

feature is required by #2139

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.63%. Comparing base (6083948) to head (05e88ad).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2140      +/-   ##
==========================================
+ Coverage   58.53%   58.63%   +0.09%     
==========================================
  Files          61       61              
  Lines        9187     9193       +6     
==========================================
+ Hits         5378     5390      +12     
+ Misses       3809     3803       -6     

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

lnbits/db.py Outdated Show resolved Hide resolved
@motorina0
Copy link
Collaborator

Please add some unit tests.

@motorina0
Copy link
Collaborator

Can we please have one small test for GROUP BY.

@prusnak prusnak added this to the 0.12.0 milestone Dec 16, 2023
@dni
Copy link
Member Author

dni commented Dec 20, 2023

added tests

lnbits/db.py Outdated Show resolved Hide resolved
tests/helpers.py Outdated Show resolved Hide resolved
@dni dni force-pushed the feat-groupby-fetchpage branch 2 times, most recently from 9594a86 to 72e08f3 Compare January 22, 2024 08:45
@dni dni requested a review from motorina0 January 22, 2024 08:46
@dni dni modified the milestones: 0.12.0, 0.12.1 Feb 5, 2024
@@ -179,16 +179,27 @@ async def fetch_page(
values: Optional[List[str]] = None,
filters: Optional[Filters] = None,
model: Optional[Type[TRowModel]] = None,
group_by: Optional[List[str]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The users need to know that they have to add an aggregator function (max, count, etc) when using group_by. Otherwise the query execution will fail.

Can this requirement be documented somewhere?

@dni dni modified the milestones: 0.12.2, 0.12.3 Feb 15, 2024
@dni dni merged commit 7ce4edd into dev Mar 12, 2024
23 checks passed
@dni dni deleted the feat-groupby-fetchpage branch March 12, 2024 12:55
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.

None yet

4 participants