-
Notifications
You must be signed in to change notification settings - Fork 58
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 #37
base: main
Are you sure you want to change the base?
Solution #37
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 project! While your code is generally well-structured and meets many of the task requirements, there are a few critical issues that need to be addressed before we can approve the pull request:
-
Logical Error in Validation: The
create_movie
function has an incorrect condition for validating themovie.score
field. The condition should allow scores between 0 and 100, inclusive. Please update the condition tonot (0 <= movie.score <= 100)
. -
Debugging Print Statement: There is a
print
statement in theupdate_movie
function that should be removed to prevent unnecessary console output in production. -
Incorrect Return Type Hint: The
get_movie
function's return type hint is incorrect. It should be-> MovieModel
instead of-> Type[MovieModel]
. -
Commented-Out Field Constraints: In
src/schemas/movies.py
, severalField
constraints are commented out. These should be uncommented to enforce validation rules for fields likerevenue
,budget
,score
, andname
. -
Type Hint for
get_or_404
Function: The type hint for themodel
parameter should beType[Base]
to make the function more generic. -
Typo in Docstring: There's a typo in the docstring where 'filed' should be corrected to 'field'.
Once these issues are resolved, your code will be in great shape! Keep up the good work, and don't hesitate to reach out if you have any questions or need further clarification. 😊
✨ 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.
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.
Great job on addressing several issues from the previous review! 🎉 However, there are still some critical points that need attention to ensure your code is robust and meets the task requirements:
-
Logical Error in Validation: The
create_movie
function has an incorrect condition for validating themovie.score
field. Please update the condition to allow scores between 0 and 100, inclusive:not (0 <= movie.score <= 100)
. -
Debugging Print Statements: The
update_movie
function contains aprint
statement that should be removed to prevent unnecessary console output in production. Similarly, replace any otherprint
statements with proper logging for consistency. -
Incorrect Return Type Hint: Ensure the
get_movie
function's return type hint is-> MovieModel
instead of-> Type[MovieModel]
. -
Commented-Out Field Constraints: In your schema file, uncomment the
Field
constraints to enforce validation rules for fields likerevenue
,budget
,score
, andname
. -
Type Hint for
get_or_404
Function: Update the type hint for themodel
parameter toType[Base]
to make the function more generic. -
Typo in Docstring: Correct the typo in the docstring from 'filed' to 'field'.
Remember, addressing these issues will not only improve your code quality but also enhance your learning experience. Keep up the good work, and continue refining your skills! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
No description provided.