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 #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

solution #27

wants to merge 1 commit into from

Conversation

Morphin20th
Copy link

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.

Great job on implementing the task requirements! 🎉 While there are a few minor issues, such as redundant validation checks and an incorrect import statement, these do not significantly impact the functionality. Keep up the good work and consider addressing these minor points for cleaner code in the future! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -1,10 +1,77 @@
from math import ceil

Choose a reason for hiding this comment

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

The import statement from math import ceil is incorrect. It should be from math import ceil without the division operator /. This will cause a syntax error.

Comment on lines +18 to +28
if page < 1:
raise HTTPException(
status_code=422,
detail=[
{
"loc": ["query", "page"],
"msg": "ensure this value is greater than or equal to 1",
"type": "value_error.number.not_ge"
}
]
)

Choose a reason for hiding this comment

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

The validation for page being less than 1 is redundant because the Query parameter already enforces ge=1. This check can be removed to simplify the code.

Comment on lines +30 to +40
if per_page < 1 or per_page > 20:
raise HTTPException(
status_code=422,
detail=[
{
"loc": ["query", "per_page"],
"msg": "ensure this value is between 1 and 20",
"type": "value_error.number.not_in_range"
}
]
)

Choose a reason for hiding this comment

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

The validation for per_page being less than 1 or greater than 20 is redundant because the Query parameter already enforces ge=1 and le=20. This check can be removed to simplify the code.


class Config:
orm_mode = True
from_attributes = True

Choose a reason for hiding this comment

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

The from_attributes = True configuration option is not a valid Pydantic configuration and should be removed. Pydantic models do not support this option.

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