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

Solution #37

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Solution #37

wants to merge 6 commits into from

Conversation

u123dev
Copy link

@u123dev u123dev commented Jan 31, 2025

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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:

  1. Logical Error in Validation: The create_movie function has an incorrect condition for validating the movie.score field. The condition should allow scores between 0 and 100, inclusive. Please update the condition to not (0 <= movie.score <= 100).

  2. Debugging Print Statement: There is a print statement in the update_movie function that should be removed to prevent unnecessary console output in production.

  3. Incorrect Return Type Hint: The get_movie function's return type hint is incorrect. It should be -> MovieModel instead of -> Type[MovieModel].

  4. Commented-Out Field Constraints: In src/schemas/movies.py, several Field constraints are commented out. These should be uncommented to enforce validation rules for fields like revenue, budget, score, and name.

  5. Type Hint for get_or_404 Function: The type hint for the model parameter should be Type[Base] to make the function more generic.

  6. 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.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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:

  1. Logical Error in Validation: The create_movie function has an incorrect condition for validating the movie.score field. Please update the condition to allow scores between 0 and 100, inclusive: not (0 <= movie.score <= 100).

  2. Debugging Print Statements: The update_movie function contains a print statement that should be removed to prevent unnecessary console output in production. Similarly, replace any other print statements with proper logging for consistency.

  3. Incorrect Return Type Hint: Ensure the get_movie function's return type hint is -> MovieModel instead of -> Type[MovieModel].

  4. Commented-Out Field Constraints: In your schema file, uncomment the Field constraints to enforce validation rules for fields like revenue, budget, score, and name.

  5. Type Hint for get_or_404 Function: Update the type hint for the model parameter to Type[Base] to make the function more generic.

  6. 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! ✨

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.

2 participants