-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Develop #1401
Conversation
There was a problem hiding this 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
parameters[args] = func(*args) | ||
print("Calculating new result ") | ||
return func(*args) |
There was a problem hiding this comment.
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]
.
There was a problem hiding this 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! ✨
No description provided.