Skip to content

library task completed#577

Open
YanTumar wants to merge 2 commits intomate-academy:mainfrom
YanTumar:develop
Open

library task completed#577
YanTumar wants to merge 2 commits intomate-academy:mainfrom
YanTumar:develop

Conversation

@YanTumar
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

There are no files to review. Please make sure that you have added files to the pull request. Some files and directories may be ignored from the review or failed to load.
[CODE: NFR]

Additional info:
Ignored files list:

  • crud.py
  • database.py
  • main.py
  • models.py
  • schemas.py

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

Copy link
Copy Markdown

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

Review Summary

Excellent work on this project! Your submission successfully meets all the requirements, with a well-structured application and all API endpoints functioning correctly. I am approving your solution.

As a small point of feedback for future reference, in crud.py you've used the Pydantic .dict() method. While this works, the recommended method in newer versions of Pydantic is .model_dump(). Adopting this practice will help keep your code aligned with the latest standards. This is just a suggestion for improvement and doesn't affect the functionality of your current code.

Overall, this is a very solid implementation. Keep up the great work!


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

Footnotes

  1. Rate AI review example

Comment thread crud.py
return db.query(models.Author).offset(skip).limit(limit).all()

def create_author(db: Session, author: schemas.AuthorCreate):
db_author = models.Author(**author.dict())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While .dict() works, it is deprecated in Pydantic V2. The recommended method is now .model_dump(). Updating this will ensure your code is more future-proof.

Comment thread crud.py
return query.offset(skip).limit(limit).all()

def create_book(db: Session, book: schemas.BookCreate):
db_book = models.Book(**book.dict())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Similar to the create_author function, .dict() is deprecated in Pydantic V2. It's better to use .model_dump() for converting the schema to a dictionary.

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