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

Enhancing ABC Enforcement and Standardizing Subclass Implementations #795

Merged
merged 18 commits into from
Feb 17, 2025

Conversation

YanSte
Copy link
Contributor

@YanSte YanSte commented Feb 16, 2025

This pull request enhances the proper implementation of subclasses by improving abstract base classes (ABCs) and enforcing method consistency.

Key Changes:

  • Added ABC inheritance and @abstractmethod decorators where necessary to ensure proper enforcement of method implementation.
  • Ensured all base class methods are properly implemented in subclasses, preventing missing abstract methods and making the codebase more robust.
    • Many methods are still missing, but we can see where now.
    • This ensures that if a method is added to the base class, it must be implemented across all subclasses.
  • Standardized method signatures across different storage classes to improve consistency and maintainability.
  • Implemented missing methods in subclasses to align with the base class structure.
  • Added final where applicable to define final class implementations.
  • Began adding try-import handling, with plans to remove pm in the future for a cleaner library import structure.

These improvements ensure a more structured, maintainable, and error-free codebase while enhancing subclass compliance with ABCs.

@YanSte YanSte marked this pull request as draft February 16, 2025 12:25
@YanSte YanSte marked this pull request as ready for review February 16, 2025 14:24
@YanSte YanSte changed the title updated clean of what implemented on BaseVectorStorage Enhancing ABC Enforcement and Standardizing Subclass Implementations Feb 16, 2025
…mented-or-not

# Conflicts:
#	lightrag/base.py
#	lightrag/kg/json_doc_status_impl.py
#	lightrag/kg/mongo_impl.py
#	lightrag/kg/postgres_impl.py
@YanSte YanSte marked this pull request as draft February 16, 2025 14:36
@YanSte YanSte marked this pull request as ready for review February 16, 2025 14:56
@LarFii LarFii merged commit 9a1603f into HKUDS:main Feb 17, 2025
1 check passed
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