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

code refactor (backend): replace query api .one_or_none() to .first() #1836

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

aybruhm
Copy link
Member

@aybruhm aybruhm commented Jul 2, 2024

No description provided.

Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 11:01am

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 2, 2024
@aybruhm aybruhm requested a review from aakrem July 2, 2024 10:59
Copy link
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

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

Are you sure one_or_none is deprecated? Could not find that in the documentation

It seems to make sense in this case because it raises an exception if there are more than one result for the query.

@aybruhm aybruhm changed the title refactor (backend): replace deprecated legacy query api .one_or_none() to .first() code refactor (backend): replace query api .one_or_none() to .first() Jul 2, 2024
@aybruhm aybruhm changed the base branch from postgres-migration to cloud-migration/beanie-to-sqlalchemy July 2, 2024 11:45
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 2, 2024
@aybruhm aybruhm changed the base branch from cloud-migration/beanie-to-sqlalchemy to postgres-migration July 2, 2024 11:46
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 2, 2024
@aybruhm
Copy link
Member Author

aybruhm commented Jul 2, 2024

Are you sure one_or_none is deprecated? Could not find that in the documentation

Yes, it's not. I've updated the title.

It seems to make sense in this case because it raises an exception if there are more than one result for the query.

Yes, yes.

@aakrem aakrem merged commit 0b965ea into postgres-migration Jul 2, 2024
5 of 6 checks passed
@aakrem aakrem deleted the refactor/replace-one_or_none-to-first branch July 2, 2024 11:59
@aakrem
Copy link
Collaborator

aakrem commented Jul 2, 2024

regarding the deprecation it's my mistake. I wrote Abraham that it's deprecated and corrected it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend refactoring size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants