Skip to content

Refactor: Add comprehensive type hints and fix search_title bug#75

Open
anzinmhd wants to merge 1 commit into
video-db:mainfrom
anzinmhd:refactor/add-client-type-hints
Open

Refactor: Add comprehensive type hints and fix search_title bug#75
anzinmhd wants to merge 1 commit into
video-db:mainfrom
anzinmhd:refactor/add-client-type-hints

Conversation

@anzinmhd
Copy link
Copy Markdown

@anzinmhd anzinmhd commented May 7, 2026

Description

This PR implements enterprise-grade type hints across the core VideoDB Python SDK. It also fixes a structural bug in the search_title method and resolves a pending TODO for the Meeting type check.

Key Changes

  • Type Safety: Added type hints to all major modules (client, collection, video, editor, rtstream, audio, etc.) to improve IDE support and prevent bugs.
  • Bug Fix: Updated Collection.search_title to return List[Video] instead of raw dictionaries, ensuring consistency with the rest of the SDK.
  • Technical Debt: Resolved the long-standing TODO in video.py for the Meeting class type check.
  • Architectural Polish: Handled circular dependencies using TYPE_CHECKING blocks and string forward references.

Verification (Proof)

  • New Tests: Added tests/test_collection.py and tests/test_video.py to verify the fixes.
  • Pytest: Ran full suite, 7/7 tests passed.
  • Linting: Verified with ruff check . (0 errors).

- Implement type hints across core SDK (client, collection, video, editor, etc.)
- Fix search_title in collection.py to correctly return List[Video]
- Resolve TODO for Meeting type check in video.py
- Handle circular imports using TYPE_CHECKING and forward references
- Add unit tests for search_title and get_meeting verification
- Ensure ruff and pytest compliance
@anzinmhd
Copy link
Copy Markdown
Author

Hi everyone, I wanted to follow up on this PR. I’ve implemented PEP 484 type hints to improve IDE support and resolved a circular dependency issue that was impacting the core architecture. I’ve also added unit tests and verified the fix for search_title using pytest. I understand you are all very busy, but if you could find some time to review this, I’d love to hear your thoughts on these architectural improvements. I’m happy to make any adjustments based on your feedback!.

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.

1 participant