-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[ENH] Export schema and search types from chromadb.api #5736
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
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
40f350f to
b2cf7cd
Compare
|
Expose search & schema symbols through Streamlines end-user imports by re-exporting all schema-related types from Key Changes• Prepended Affected Areas• This summary was automatically generated by @propel-code-bot |
38172c2 to
09a866f
Compare
b2cf7cd to
294e78e
Compare
| from chromadb.api.types import * # noqa: F401, F403 | ||
| from chromadb.execution.expression import ( # noqa: F401, F403 | ||
| Search, | ||
| Key, | ||
| K, | ||
| SearchWhere, | ||
| And, | ||
| Or, | ||
| Eq, | ||
| Ne, | ||
| Gt, | ||
| Gte, | ||
| Lt, | ||
| Lte, | ||
| In, | ||
| Nin, | ||
| Regex, | ||
| NotRegex, | ||
| Contains, | ||
| NotContains, | ||
| Limit, | ||
| Select, | ||
| Rank, | ||
| Abs, | ||
| Div, | ||
| Exp, | ||
| Log, | ||
| Max, | ||
| Min, | ||
| Mul, | ||
| Knn, | ||
| Rrf, | ||
| Sub, | ||
| Sum, | ||
| Val, | ||
| ) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
By exposing many new symbols through the chromadb.api namespace, it's important to clearly define the module's public API. Adding an __all__ variable will make it explicit which names are intended for export and will prevent leaking internal symbols (like ABC, override, Component, etc.) when users perform a wildcard import (from chromadb.api import *).
Context for Agents
[**BestPractice**]
By exposing many new symbols through the `chromadb.api` namespace, it's important to clearly define the module's public API. Adding an `__all__` variable will make it explicit which names are intended for export and will prevent leaking internal symbols (like `ABC`, `override`, `Component`, etc.) when users perform a wildcard import (`from chromadb.api import *`).
File: chromadb/api/__init__.py
Line: 3709a866f to
67f3870
Compare
b9ab17f to
fda0d66
Compare
a43db01 to
2dd65c5
Compare
fda0d66 to
840dd5d
Compare
2dd65c5 to
998da94
Compare
840dd5d to
32cfe0c
Compare
| Search, | ||
| ) | ||
|
|
||
| SearchWhere = Where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
The alias SearchWhere = Where creates a duplicate name that adds no functional value and may confuse users about which one to use. Since both SearchWhere and Where are exported in __all__, users will see both options without clear guidance on when to use each. Consider removing the alias and keeping only Where, or if the alias serves a specific backward compatibility purpose, document it with a comment explaining when to use each.
Context for Agents
[**BestPractice**]
The alias `SearchWhere = Where` creates a duplicate name that adds no functional value and may confuse users about which one to use. Since both `SearchWhere` and `Where` are exported in `__all__`, users will see both options without clear guidance on when to use each. Consider removing the alias and keeping only `Where`, or if the alias serves a specific backward compatibility purpose, document it with a comment explaining when to use each.
File: chromadb/execution/expression/__init__.py
Line: 48This reverts commit ddde624.

Description of changes
Summarize the changes made by this PR.
Test plan
How are these changes tested?
manually
pytestfor python,yarn testfor js,cargo testfor rustMigration plan
Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?
Observability plan
What is the plan to instrument and monitor this change?
Documentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?