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

Closed
wants to merge 8 commits into from
Closed

Solution #1228

wants to merge 8 commits into from

Conversation

This-is-Lapwing
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.


Thank you for your hard work on this project! 😊 While your implementation is quite solid and meets many of the task requirements, there are a couple of critical issues that need to be addressed before we can approve the pull request:

  1. Logical Issue in go_to_cafe Function: The current logic stops checking friends as soon as it encounters one who is not vaccinated. This means that not all friends are checked, which might not be the intended behavior. Consider modifying the logic to accumulate results for all friends before returning a message. This will ensure that all friends are evaluated, and a comprehensive decision can be made.

  2. Vaccine Expiration Date Comparison: The comparison of the vaccine expiration date assumes that it is a datetime.date object. Please ensure that the expiration_date is indeed a datetime.date object before performing the comparison. If it's not, you may need to convert it appropriately to avoid potential errors.

Once these issues are resolved, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you have any questions or need further assistance. 🚀

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

app/cafe.py Outdated
def visit_cafe(self, visitor: dict) -> str:
if "vaccine" not in visitor:
raise NotVaccinatedError("Visitor is not vaccinated.")
elif visitor["vaccine"]["expiration_date"] < datetime.date.today():

Choose a reason for hiding this comment

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

The comparison visitor['vaccine']['expiration_date'] < datetime.date.today() assumes that expiration_date is a datetime.date object. Ensure that the expiration_date is indeed a datetime.date object before this comparison. If it's a string or another type, you may need to convert it to a datetime.date object first.

app/main.py Outdated
Comment on lines 11 to 12
except VaccineError:
return "All friends should be vaccinated"

Choose a reason for hiding this comment

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

The current logic returns immediately if any friend is not vaccinated, which means it will not check the rest of the friends. If the intention is to ensure all friends are checked before deciding, consider accumulating the results and returning a message after the loop.

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