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

Develop #1401

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Develop #1401

wants to merge 3 commits into from

Conversation

Leron-piu
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! 😊 However, there's a critical issue that needs to be addressed before we can approve the Pull Request. The collector function currently calls func(*args) twice when the result is not cached, which is inefficient and could lead to unexpected behavior. Please modify the code to store the result in a variable and return it directly after caching. Once this is resolved, your solution will be much more efficient and ready for approval! Keep up the great work! 🚀

✨ 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/main.py Outdated
Comment on lines 9 to 11
parameters[args] = func(*args)
print("Calculating new result ")
return func(*args)

Choose a reason for hiding this comment

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

The collector function calls func(*args) twice when the result is not cached. This is redundant and inefficient. You should remove the second call to func(*args) on line 11 and instead return the result stored in parameters[args].

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 resolving the critical issue from the previous review! 🎉 The collector function now efficiently stores and caches results, preventing unexpected behavior. Your implementation of the cache decorator in app/main.py is correct and meets the task requirements. The code is clean, efficient, and handles multiple decorated functions well.

While the decision is to APPROVE to help you move forward with your learning, please review the comments to further improve your code. Remember, addressing any critical issues in the future will enhance your coding skills and prevent similar problems. Keep up the good work and continue learning from your experiences! 🚀

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

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