Skip to content

Conversation

@rescrv
Copy link
Contributor

@rescrv rescrv commented Oct 20, 2025

Description of changes

For ergonomics, export every type referenced by the chroma::collection crate from chroma::types::*.

Test plan

CI

Migration plan

N/A

Observability plan

N/A

Documentation Changes

N/A

@propel-code-bot
Copy link
Contributor

Export Additional Types from chroma Crate via types.rs

This pull request enhances the ergonomics of the chroma crate by expanding the set of types re-exported through chroma::types::*. All types referenced by the chroma::collection crate are now made accessible from this module. This change involves a single update to the rust/chroma/src/types.rs file, making these types readily available for downstream use.

Key Changes

• Added a pub use chroma_types::{...} block in rust/chroma/src/types.rs to re-export all collection-related types, including but not limited to SearchPayload, AddCollectionRecordsRequest, Collection, QueryRequest, UpsertCollectionRecordsResponse, and related types.

Affected Areas

rust/chroma/src/types.rs (exports for type re-exports from chroma_types)

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

@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)

Comment on lines +3 to +9
pub use chroma_types::{
plan::SearchPayload, AddCollectionRecordsRequest, AddCollectionRecordsResponse, Collection,
DeleteCollectionRecordsRequest, DeleteCollectionRecordsResponse, ForkCollectionRequest,
GetRequest, GetResponse, IncludeList, InternalSchema, Metadata, QueryRequest, QueryResponse,
SearchRequest, SearchResponse, UpdateCollectionRecordsRequest, UpdateCollectionRecordsResponse,
UpdateMetadata, UpsertCollectionRecordsRequest, UpsertCollectionRecordsResponse, 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]

For improved readability and easier maintenance, consider formatting this long list of re-exported types with one item per line. This follows the official Rust Style Guide which states: "If an import does require multiple lines, then break after the opening brace and before the closing brace, use a trailing comma, and block indent the names." This formatting convention helps in producing cleaner diffs when items are added or removed in the future and makes the code more maintainable.

Suggested Change
Suggested change
pub use chroma_types::{
plan::SearchPayload, AddCollectionRecordsRequest, AddCollectionRecordsResponse, Collection,
DeleteCollectionRecordsRequest, DeleteCollectionRecordsResponse, ForkCollectionRequest,
GetRequest, GetResponse, IncludeList, InternalSchema, Metadata, QueryRequest, QueryResponse,
SearchRequest, SearchResponse, UpdateCollectionRecordsRequest, UpdateCollectionRecordsResponse,
UpdateMetadata, UpsertCollectionRecordsRequest, UpsertCollectionRecordsResponse, Where,
};
pub use chroma_types::{
plan::SearchPayload,
AddCollectionRecordsRequest,
AddCollectionRecordsResponse,
Collection,
DeleteCollectionRecordsRequest,
DeleteCollectionRecordsResponse,
ForkCollectionRequest,
GetRequest,
GetResponse,
IncludeList,
InternalSchema,
Metadata,
QueryRequest,
QueryResponse,
SearchRequest,
SearchResponse,
UpdateCollectionRecordsRequest,
UpdateCollectionRecordsResponse,
UpdateMetadata,
UpsertCollectionRecordsRequest,
UpsertCollectionRecordsResponse,
Where,
};

Committable suggestion

Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Context for Agents
[**BestPractice**]

For improved readability and easier maintenance, consider formatting this long list of re-exported types with one item per line. This follows the official Rust Style Guide which states: "If an import does require multiple lines, then break after the opening brace and before the closing brace, use a trailing comma, and block indent the names." This formatting convention helps in producing cleaner diffs when items are added or removed in the future and makes the code more maintainable.

<details>
<summary>Suggested Change</summary>

```suggestion
pub use chroma_types::{
    plan::SearchPayload,
    AddCollectionRecordsRequest,
    AddCollectionRecordsResponse,
    Collection,
    DeleteCollectionRecordsRequest,
    DeleteCollectionRecordsResponse,
    ForkCollectionRequest,
    GetRequest,
    GetResponse,
    IncludeList,
    InternalSchema,
    Metadata,
    QueryRequest,
    QueryResponse,
    SearchRequest,
    SearchResponse,
    UpdateCollectionRecordsRequest,
    UpdateCollectionRecordsResponse,
    UpdateMetadata,
    UpsertCollectionRecordsRequest,
    UpsertCollectionRecordsResponse,
    Where,
};
```

⚡ **Committable suggestion**

Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

</details>

File: rust/chroma/src/types.rs
Line: 9

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Rust people wanted me to do better, they'd not have encoded bad behavior in rustfmt.

@rescrv rescrv requested a review from codetheweb October 20, 2025 22:11
GetRequest, GetResponse, IncludeList, InternalSchema, Metadata, QueryRequest, QueryResponse,
SearchRequest, SearchResponse, UpdateCollectionRecordsRequest, UpdateCollectionRecordsResponse,
UpdateMetadata, UpsertCollectionRecordsRequest, UpsertCollectionRecordsResponse, Where,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just pub use chroma_types::*? seems easy to forget to add a type here when modifying the client

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not. chroma_types::* is everything, which is too much to export. I'd rather miss something and fix it than have people depend on our internals.

@rescrv rescrv merged commit ef2ecc8 into main Oct 21, 2025
62 checks passed
@rescrv rescrv deleted the rescrv/export-types branch October 21, 2025 01:22
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