Skip to content

Solution#1818

Open
AndriiOne wants to merge 2 commits into
mate-academy:masterfrom
AndriiOne:develop
Open

Solution#1818
AndriiOne wants to merge 2 commits into
mate-academy:masterfrom
AndriiOne:develop

Conversation

@AndriiOne

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there is a critical mismatch between your public API and the task requirements. The ActorManager.update method is required to take parameters in the order (pk, new_first_name, new_last_name), but your current signature is def update(self, new_first_name: str, new_last_name: str, pk: int) (see app/managers.py), which will break any tests or callers that use the specified order. To fix this, change the signature to def update(self, pk: int, new_first_name: str, new_last_name: str) and update the cursor.execute call so the parameters are passed in that same order. This is a functional requirement, not just style, so it must be corrected before the solution can be considered complete.

Apart from this, your overall structure is good: the Actor dataclass is correctly defined, and the CRUD methods (create, all, delete) in ActorManager follow the specification. As minor improvements, address the flake8 issues (missing return type annotations and long lines) and ensure you don’t commit any .sqlite/.db3 files [CHECKLIST ITEM #1], and use a plural table name when the table holds multiple actors [CHECKLIST ITEM #2]. Once you fix the update method’s parameter order and rerun the tests, your solution should be in great shape.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread app/managers.py Outdated
Actor(*row) for row in result_cursor
]

def update(self, new_first_name: str, new_last_name: str, pk: int):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The update method parameters are ordered as (new_first_name, new_last_name, pk), but the task requires the method to take pk, new_first_name, new_last_name in that order; this violates the description requirement for the public API.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved because it meets all of the functional and checklist requirements for this task. The Actor dataclass is correctly defined with id, first_name, and last_name, and ActorManager is singular, takes db_name and table_name in __init__, and opens the SQLite connection there as required. All CRUD methods (create, all, update, delete) are present and operate on the configured table, with all() returning a list of Actor instances (or an empty list when there are no rows) and update(pk, new_first_name, new_last_name) now using the correct parameter order in both the signature and SQL statement. The .gitignore properly excludes database files like *.db and **db.sqlite3, satisfying [CHECKLIST ITEM #1], and your table name usage ("actors") is plural while the manager class remains singular, satisfying [CHECKLIST ITEM #2]. Overall, there are no critical blockers or broken behaviors evident, and the code should work as expected for the assignment. Nicely done tightening up the update method and aligning everything with the previous review feedback.


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

Footnotes

  1. Rate AI review example

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