feat: add return type hints to API endpoint functions#2072
feat: add return type hints to API endpoint functions#2072Vasilije1990 merged 2 commits intotopoteretes:devfrom
Conversation
Please make sure all the checkboxes are checked:
|
WalkthroughAdd return type annotations to five API endpoint and utility functions across delete, update, visualize, and ingestion modules to improve type safety and IDE autocompletion. Functions now explicitly declare return types as dict, Any, callable, or Union types matching their actual return values. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Hello @allenjoseph05, thank you for submitting a PR! We will respond as soon as possible.
|
@allenjoseph05 please check CONTRIBUTING.md and open a PR against dev branch + upload the screenshot of tests passing locally |
|
Hi @Vasilije1990, I've completed the type hint additions for all functions listed in the issue. However, I wanted to address the testing requirement mentioned in CONTRIBUTING.md. I attempted to run What I verified locally: |
|
@allenjoseph05 understood. We will merge it then, but please open against dev branch, not main |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 9573981 | Triggered | Generic Password | 92d6a06 | .github/workflows/examples_tests.yml | View secret |
| 8719688 | Triggered | Generic Password | 92d6a06 | .env.template | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Description
Adds missing return type hints to API endpoint functions as specified in issue #2043.
Changes Made
classify()incognee/modules/ingestion/classify.py→Union[TextData, BinaryData, S3BinaryData]delete(),delete_single_document(),delete_document_subgraph()incognee/api/v1/delete/delete.py→dictupdate()incognee/api/v1/update/update.py→Anyvisualization_server()incognee/api/v1/visualize/start_visualization_server.py→callablevisualize_graph()incognee/api/v1/visualize/visualize.py→Anyui.pyfunctions already had return type hintsTesting
Related Issue
Fixes #2043
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.