Skip to content

fix: Remove deprecated backward-compatibility methods in CacheDBInt...#2332

Closed
JiwaniZakir wants to merge 1 commit intotopoteretes:mainfrom
JiwaniZakir:fix/issue-2306
Closed

fix: Remove deprecated backward-compatibility methods in CacheDBInt...#2332
JiwaniZakir wants to merge 1 commit intotopoteretes:mainfrom
JiwaniZakir:fix/issue-2306

Conversation

@JiwaniZakir
Copy link

@JiwaniZakir JiwaniZakir commented Mar 9, 2026

Summary

Fixes #2306.

What changed

Implemented a fix based on the issue description. See the diff for specifics.

Testing

  • Verified against the existing test suite
  • Checked that the fix addresses the reported behavior

Summary by CodeRabbit

  • Refactor
    • Removed deprecated cache query methods and updated internal references to use current method names. No user-facing changes.

…face (topoteretes#2306)

Remove add_qa, get_latest_qa, and get_all_qas deprecated methods from
CacheDBInterface that had explicit TODO: delete comments. Migrate the
only caller (test_conversation_history.py) to use get_latest_qa_entries.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pull-checklist
Copy link

pull-checklist bot commented Mar 9, 2026

Please make sure all the checkboxes are checked:

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have added end-to-end and unit tests (if applicable).
  • I have updated the documentation and README.md file (if necessary).
  • I have removed unnecessary code and debug statements.
  • PR title is clear and follows the convention.
  • I have tagged reviewers or team members for feedback.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

Walkthrough

Removal of three deprecated backward-compatibility methods from CacheDBInterface (add_qa, get_latest_qa, get_all_qas) and elimination of associated uuid import. Test callers updated to use new method names (get_latest_qa_entries) instead of deprecated equivalents.

Changes

Cohort / File(s) Summary
Deprecated method removal
cognee/infrastructure/databases/cache/cache_db_interface.py
Removed three deprecated backward-compatibility wrapper methods: add_qa(), get_latest_qa(), get_all_qas(). Removed unused uuid import previously used only by add_qa(). Abstract method signatures remain unchanged.
Test caller updates
cognee/tests/test_conversation_history.py
Updated all call sites from deprecated get_latest_qa() to new method name get_latest_qa_entries(). Test logic and assertions unchanged; only method invocations updated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It lacks specific details about what was changed, test results, and does not follow the template structure with clear sections for Description, Acceptance Criteria, and Type of Change. Expand the description with specific details about removed methods, provide explicit test results, and follow the repository's PR template structure more closely with all required sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing deprecated backward-compatibility methods from CacheDBInterface, which is the primary objective of this PR.
Linked Issues check ✅ Passed The PR successfully addresses all acceptance criteria from issue #2306: deprecated methods removed from CacheDBInterface, callers migrated to new API (test_conversation_history.py), and existing tests verified.
Out of Scope Changes check ✅ Passed All changes are within scope. The PR removes only the three deprecated methods (add_qa, get_latest_qa, get_all_qas) and updates the only caller, with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cognee/tests/test_conversation_history.py (1)

25-25: Consider adding return type annotation to main().

Per coding guidelines, Python functions should have type hints. Since this is an async function returning nothing, the signature could be:

async def main() -> None:

This is a minor improvement and doesn't block the deprecation fix.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cognee/tests/test_conversation_history.py` at line 25, Add a return type
annotation to the async function main by changing its signature to declare it
returns None; locate the async def main(...) definition and update it to async
def main() -> None: so the function adheres to the project's type-hinting
guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cognee/tests/test_conversation_history.py`:
- Line 25: Add a return type annotation to the async function main by changing
its signature to declare it returns None; locate the async def main(...)
definition and update it to async def main() -> None: so the function adheres to
the project's type-hinting guidelines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e24cd2f4-9e8c-4e14-88b9-989182b3b6e6

📥 Commits

Reviewing files that changed from the base of the PR and between c9370a8 and 788be02.

📒 Files selected for processing (2)
  • cognee/infrastructure/databases/cache/cache_db_interface.py
  • cognee/tests/test_conversation_history.py
💤 Files with no reviewable changes (1)
  • cognee/infrastructure/databases/cache/cache_db_interface.py

@JiwaniZakir
Copy link
Author

Closing this out. Some problems with my git setup leaked into the commits. Will resubmit a clean version if the issue is still around.

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.

Remove deprecated backward-compatibility methods in CacheDBInterface

1 participant