-
Notifications
You must be signed in to change notification settings - Fork 56
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
"Solution" #39
base: main
Are you sure you want to change the base?
"Solution" #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your hard work on this Pull Request! There are a few critical issues that need to be addressed before we can proceed. The import statement for ceil
is incorrect, and there are inconsistencies in the endpoint paths for pagination logic. Additionally, the limit
method call needs to be corrected. Please make these changes to ensure the functionality aligns with the task requirements. Keep up the great work, and feel free to reach out if you need any assistance! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
@@ -1,10 +1,49 @@ | |||
from math import ceil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement for ceil
is incorrect. It should be from math import ceil
instead of from math import ceil /++1++/
.
src/routes/movies.py
Outdated
skip = (page - 1) * per_page | ||
limit = per_page | ||
|
||
films = db.query(MovieModel).offset(skip).limit(limit=limit).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The limit
method is incorrectly called with a keyword argument limit=limit
. It should be limit(limit)
without the keyword.
src/routes/movies.py
Outdated
total_items = db.query(MovieModel).count() | ||
total_pages = ceil(total_items / per_page) | ||
|
||
prev_page = f"/theater/movies/?page={page - 1}&per_page={per_page}" if page > 1 else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint path in prev_page
is inconsistent with the defined route. It should be /movies/
instead of /theater/movies/
.
src/routes/movies.py
Outdated
total_pages = ceil(total_items / per_page) | ||
|
||
prev_page = f"/theater/movies/?page={page - 1}&per_page={per_page}" if page > 1 else None | ||
next_page = f"/theater/movies/?page={page + 1}&per_page={per_page}" if page < total_pages else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint path in next_page
is inconsistent with the defined route. It should be /movies/
instead of /theater/movies/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Great job on implementing the required endpoints and schemas! 🎉 Your code meets the task requirements and constraints, and the models are well-structured. However, there are a couple of critical issues that need your attention:
-
Import Statement for
ceil
: The import statement forceil
is incorrect. Please ensure it isfrom math import ceil
to avoid import errors. -
Endpoint Path Consistency: The root path is currently set to
/theater
, which is inconsistent with the pagination logic. It should be/movies
to align with the endpoint paths.
These issues should be addressed to ensure the functionality aligns with the task requirements. Fixing them will help you avoid similar problems in the future. Keep up the good work, and continue learning from these experiences! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -1,10 +1,50 @@ | |||
from math import ceil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement for ceil
is incorrect. It should be from math import ceil
without the division operator.
total_items = db.query(MovieModel).count() | ||
total_pages = ceil(total_items / per_page) | ||
|
||
root = "/theater" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root path is set to /theater
, which is inconsistent with the endpoint paths used in the pagination logic. It should be /movies
to match the endpoint paths.
No description provided.