Skip to content

Conversation

@jairad26
Copy link
Contributor

@jairad26 jairad26 commented Oct 24, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • This PR adds support for importing all search and schema related types from chromadb.api for simplified usage
  • New functionality
    • ...

Test plan

How are these changes tested?
manually

  • [ x] Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration 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?

Copy link
Contributor Author

jairad26 commented Oct 24, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@jairad26 jairad26 force-pushed the jai/export-top-level branch 2 times, most recently from 40f350f to b2cf7cd Compare October 24, 2025 18:54
@jairad26 jairad26 marked this pull request as ready for review October 24, 2025 18:54
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Oct 24, 2025

Expose search & schema symbols through chromadb.api namespace

Streamlines end-user imports by re-exporting all schema-related types from chromadb.api.types and most search expression helpers from chromadb.execution.expression. A small alias (SearchWhere) was introduced and included in __all__ to clarify semantics. No functional logic was modified; changes are limited to import/export wiring.

Key Changes

• Prepended chromadb/api/__init__.py with wildcard import of chromadb.api.types and an explicit re-export list from chromadb.execution.expression (e.g., Search, Eq, Knn, etc.)
• Removed redundant import chromadb.execution.expression.plan.Search that is now covered by the new bulk import
• Added alias SearchWhere = Where in chromadb/execution/expression/__init__.py and exposed it via __all__

Affected Areas

chromadb/api/__init__.py public API surface
chromadb/execution/expression/__init__.py symbol table

This summary was automatically generated by @propel-code-bot

@jairad26 jairad26 force-pushed the jai/add-new-schema-keys-local-compaction branch from 38172c2 to 09a866f Compare October 24, 2025 23:19
@jairad26 jairad26 force-pushed the jai/export-top-level branch from b2cf7cd to 294e78e Compare October 24, 2025 23:19
Comment on lines +1 to +37
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,
)

Copy link
Contributor

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: 37

@jairad26 jairad26 force-pushed the jai/add-new-schema-keys-local-compaction branch from 09a866f to 67f3870 Compare October 27, 2025 17:44
@jairad26 jairad26 force-pushed the jai/export-top-level branch 2 times, most recently from b9ab17f to fda0d66 Compare October 27, 2025 19:47
@jairad26 jairad26 force-pushed the jai/add-new-schema-keys-local-compaction branch 2 times, most recently from a43db01 to 2dd65c5 Compare October 27, 2025 22:49
@jairad26 jairad26 force-pushed the jai/export-top-level branch from fda0d66 to 840dd5d Compare October 27, 2025 22:49
@jairad26 jairad26 changed the base branch from jai/add-new-schema-keys-local-compaction to graphite-base/5736 October 28, 2025 06:10
@jairad26 jairad26 force-pushed the jai/export-top-level branch from 840dd5d to 32cfe0c Compare October 28, 2025 06:10
@jairad26 jairad26 changed the base branch from graphite-base/5736 to main October 28, 2025 06:10
@jairad26 jairad26 enabled auto-merge (squash) October 28, 2025 06:11
Search,
)

SearchWhere = Where
Copy link
Contributor

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: 48

@jairad26 jairad26 merged commit ddde624 into main Oct 28, 2025
128 of 137 checks passed
sanketkedia added a commit that referenced this pull request Oct 28, 2025
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.

3 participants