-
Notifications
You must be signed in to change notification settings - Fork 124
[Core] Improved cache key generation for instance/class methods in Ocean's caching utilities #2235
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
PR Code Suggestions ✨Explore these optional code suggestions:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18209100207/artifacts/4170815102Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18209234394/artifacts/4170858846Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18209261665/artifacts/4170865791Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18209244689/artifacts/4170866123Code Coverage Total Percentage:
|
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.
LGTM
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18220579215/artifacts/4174395741Code Coverage Total Percentage:
|
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.
LGTM
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18466049968/artifacts/4254658519Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18471179225/artifacts/4256516717Code Coverage Total Percentage:
|
User description
Description
What - Improved cache key generation for instance/class methods in Ocean's caching utilities
Why - The existing cache key generation only used function names and didn't properly handle instance/class methods. This caused inconsistent caching behavior where different instances of the same class would share cache keys inappropriately, or instance methods would have cache keys that included the
self
parameter which shouldn't affect caching.How -
hash_func
to accept function objects instead of just namessanitize_identifier
function to create backend-safe cache keysself
parameter for instance/class methodsType of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
PR Type
Enhancement
Description
Enhanced cache key generation for instance/class methods
Added comprehensive test coverage for all method types
Improved cache key uniqueness with module and qualname
Added backend-safe identifier sanitization
Diagram Walkthrough
File Walkthrough
cache.py
Enhanced cache key generation logic
port_ocean/utils/cache.py
hash_func
to accept function objects instead of namessanitize_identifier
for backend-safe cache keysself
parameter for instance methodstest_cache.py
Comprehensive test coverage for method caching
port_ocean/tests/utils/test_cache.py
self
parameterCHANGELOG.md
Version 0.28.13 changelog entry
CHANGELOG.md