Skip to content

Conversation

@daukadolt
Copy link
Contributor

@daukadolt daukadolt commented Aug 12, 2025

Description

Restored and enhanced the CogneeGraphRAG integration that was previously moved to stale packages due to broken tests. This change fixes the existing test issues and adds comprehensive test coverage to ensure the integration is robust and reliable.

The restored integration now includes:

  • Fixed existing test failures that caused the package to be moved to stale
  • Enhanced test coverage for edge cases, error handling, and input validation
  • Mocked workflows that don't require external API dependencies for CI/CD
  • Improved error handling and validation

The new test suite covers:

  • Empty document handling and validation
  • Single document vs list processing
  • Graph visualization functionality
  • Search error handling with empty results
  • Complete workflow testing with mocked dependencies
  • Mixed document types with edge cases

This addresses the issues mentioned in PR #19627 where tests were broken, making the integration production-ready again.

Fixes # (restores functionality from stale packages)

New Package?

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes
  • No

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran uv run make format; uv run make lint to appease the lint gods

Restoration Details

This PR addresses the issues that caused cognee to be moved to stale packages:

  1. Fixed broken tests - Resolved the test failures mentioned in the stale move
  2. Enhanced test coverage - Added comprehensive tests for edge cases and error scenarios
  3. Improved reliability - Added mocked tests that work without external dependencies
  4. Better error handling - Ensured graceful handling of various input scenarios

The new test suite includes:

  1. test_empty_documents() - Tests handling of empty document lists and validates proper error handling
  2. test_single_document() - Tests processing single documents vs lists of documents
  3. test_visualize_graph() - Tests graph visualization with different parameters and error conditions
  4. test_search_error_handling() - Tests behavior when search methods return empty results
  5. test_mock_full_workflow() - Complete workflow test with mocked dependencies for offline testing
  6. test_mixed_document_types() - Tests handling of mixed valid/invalid document types

The integration is now ready for production use with reliable test coverage.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@daukadolt daukadolt marked this pull request as ready for review August 12, 2025 17:48
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 12, 2025

[project]
name = "llama-index-graph-rag-cognee"
version = "0.2.1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets bump this to 0.3.0?

Copy link
Contributor Author

@daukadolt daukadolt Aug 12, 2025

Choose a reason for hiding this comment

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

sounds good, updating

@logan-markewich
Copy link
Collaborator

Seems like we either need to mark some tests as skip if llm credentials are missing or mock out the llm calls?

@daukadolt
Copy link
Contributor Author

Apologies, I forgot to skip unit tests that rely on LLM credentials, let me update the PR

@logan-markewich
Copy link
Collaborator

Thanks for the efforts here!

@logan-markewich logan-markewich merged commit fe3c613 into run-llama:main Aug 12, 2025
11 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants