Skip to content

Conversation

@Nevi-cpu
Copy link

@Nevi-cpu Nevi-cpu commented Nov 3, 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.

Review Summary

Great job on implementing the core functionality, as the Person class and spouse-linking logic work correctly. However, this submission requires changes to meet specific project guidelines. Please refactor your code to use a list comprehension for creating Person instances instead of a for loop [CHECKLIST ITEM #3]. Additionally, when checking for spouse data, you must use the dict.get() method for both 'wife' and 'husband' keys instead of checking for key existence with in [CHECKLIST ITEM #4]. These changes are important for adhering to the required implementation patterns.


✨ 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

app/main.py Outdated
Comment on lines 16 to 17
for person_data in people:
Person(person_data["name"], person_data["age"])

Choose a reason for hiding this comment

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

This violates checklist item #3: 'When creating a list of instances from a collection (such as a list of dictionaries), it is recommended to use list comprehension rather than traditional for loops.' The Person instances should be created using a list comprehension.

app/main.py Outdated
for person_data in people:
person_obj = Person.people[person_data["name"]]

if "wife" in person_data and person_data["wife"] is not None:

Choose a reason for hiding this comment

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

This violates checklist item #4: 'When accessing values in a dictionary, it is better to use the dict.get() method instead of explicitly checking for the presence of a key.' This condition can be simplified by using person_data.get('wife').

app/main.py Outdated
wife_obj = Person.people[wife_name]
person_obj.wife = wife_obj

if "husband" in person_data and person_data["husband"] is not None:

Choose a reason for hiding this comment

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

This violates checklist item #4: 'When accessing values in a dictionary, it is better to use the dict.get() method...'. Similar to the check for 'wife', you should use the .get() method to check for a husband.

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.

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

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

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

@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

Thanks for the update. The core logic for creating Person instances and linking them is correct. However, this submission requires changes because the specific implementation requirements from the previous review have not yet been applied.

Please address the following two checklist items:

  1. The for loop used to create the initial list of Person instances must be refactored into a list comprehension. [CHECKLIST ITEM #3]
  2. When checking for a spouse, you must use the dict.get() method (e.g., person_data.get("wife")) instead of checking for key existence with if "wife" in person_data. [CHECKLIST ITEM #4]

Once these requirements are met, your solution will be ready for approval.


✨ 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

app/main.py Outdated
Comment on lines 16 to 17
for person_data in people:
Person(person_data["name"], person_data["age"])

Choose a reason for hiding this comment

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

This violates checklist item #3: 'When creating a list of instances from a collection (such as a list of dictionaries), it is recommended to use list comprehension rather than traditional for loops.' Please refactor this loop into a list comprehension to create the Person instances.

app/main.py Outdated
for person_data in people:
person_obj = Person.people[person_data["name"]]

if "wife" in person_data and person_data["wife"] is not None:

Choose a reason for hiding this comment

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

This violates checklist item #4: 'When accessing values in a dictionary, it is better to use the dict.get() method instead of explicitly checking for the presence of a key.' This check should be updated to use person_data.get("wife").

app/main.py Outdated
wife_obj = Person.people[wife_name]
person_obj.wife = wife_obj

if "husband" in person_data and person_data["husband"] is not None:

Choose a reason for hiding this comment

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

Similar to the check for a wife, this violates checklist item #4. Please use person_data.get("husband") to check for this key.

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.

Review Summary

Excellent work on this update! I'm happy to approve your solution. You've done a fantastic job of refactoring the code to incorporate the feedback from the last review. Using a list comprehension to create the Person instances and dict.get() to safely handle the spouse attributes makes the code much cleaner and more robust. The implementation now perfectly meets all the requirements. Well done!


✨ 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