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

Add QuerySet.first_or_none #1137

Merged
merged 6 commits into from
May 26, 2024
Merged

Conversation

dekoza
Copy link
Contributor

@dekoza dekoza commented Jul 10, 2023

As I mentioned in #1136 - here's the code providing missing first_or_none method.

I also update docstrings to better match what each method actually raises.

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5494503) to head (fc288bb).
Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1137   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          204       204           
  Lines        14835     14845   +10     
=========================================
+ Hits         14835     14845   +10     
Files Coverage Δ
ormar/queryset/queryset.py 100.00% <100.00%> (ø)
tests/test_model_definition/test_models.py 100.00% <100.00%> (ø)

ormar/queryset/queryset.py Outdated Show resolved Hide resolved
ormar/queryset/queryset.py Show resolved Hide resolved
@collerek
Copy link
Owner

collerek commented Dec 6, 2023

Sorry for the long time of review :/

Copy link

codspeed-hq bot commented May 26, 2024

CodSpeed Performance Report

Merging #1137 will improve performances by 13.67%

Comparing dekoza:feature/first_or_none (fc288bb) with master (5494503)

Summary

⚡ 3 improvements
✅ 81 untouched benchmarks

Benchmarks breakdown

Benchmark master dekoza:feature/first_or_none Change
test_deleting_individually[20] 18.6 ms 16.4 ms +13.67%
test_deleting_individually[40] 36.4 ms 32.1 ms +13.57%
test_updating_models_individually[40] 47.4 ms 43 ms +10.39%

@collerek collerek merged commit a6462a0 into collerek:master May 26, 2024
16 checks passed
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

3 participants