Skip to content

Conversation

@jairad26
Copy link
Contributor

@jairad26 jairad26 commented Nov 3, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • There is a bug in schema where is_default_schema does not check the space when confirming if the schema is default. This was hidden by our e2e tests, since we used an ef with a default space of cosine. therefore the configuration was cosine and was automatically converted into the schema and tests passed. this PR adds a new test to confirm the basic space setting scenario works
  • New functionality
    • ...

Test plan

How are these changes tested?

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

@jairad26 jairad26 requested a review from sanketkedia November 3, 2025 18:12
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

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)

Copy link
Contributor Author

jairad26 commented Nov 3, 2025

@jairad26 jairad26 marked this pull request as ready for review November 3, 2025 18:14
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Nov 3, 2025

Fix is_default() to validate space for default & #embedding vector configs

The PR addresses an edge-case where Schema::is_default() incorrectly reported schemas as default when the vector-index space field was explicitly set (e.g., Some(Cosine)) instead of being left None. The logic now explicitly calls the new helper is_space_default() for both the top-level defaults and the #embedding key. Additional Rust unit tests and Python e2e tests cover the updated behaviour to prevent regressions.

Key Changes

• Added is_space_default() helper and integrated it into Schema::is_value_types_default() and Schema::is_embedding_value_types_default() in rust/types/src/collection_schema.rs
• Updated is_default() early-return conditions to include space validation
• New Rust unit tests test_is_schema_default_with_space & test_is_schema_default_with_embedding_function verifying non-default detection when space/embedding_function differ
• Python e2e tests extended (chromadb/test/api/test_schema_e2e.py) to persist and reload collections that specify space, ensuring cross-language correctness

Affected Areas

Schema::is_default evaluation logic
• Default schema reconciliation pathways that rely on is_default()
• Test suites (Rust + Python)

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

@jairad26 jairad26 force-pushed the jai/fix-is-default-schema-check branch 2 times, most recently from 3df7c34 to dea4481 Compare November 3, 2025 18:18
@jairad26 jairad26 merged commit a22959d into main Nov 3, 2025
62 checks passed
chroma-droid pushed a commit that referenced this pull request Nov 3, 2025
…bedding (#5787)

## Description of changes

_Summarize the changes made by this PR._

- Improvements & Bug fixes
- There is a bug in schema where is_default_schema does not check the
space when confirming if the schema is default. This was hidden by our
e2e tests, since we used an ef with a default space of cosine. therefore
the configuration was cosine and was automatically converted into the
schema and tests passed. this PR adds a new test to confirm the basic
space setting scenario works
- New functionality
  - ...

## Test plan

_How are these changes tested?_

- [ ] 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](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
sanketkedia pushed a commit that referenced this pull request Nov 3, 2025
This PR cherry-picks the commit a22959d
onto release/2025-10-24. If there are unresolved conflicts, please
resolve them manually.

Co-authored-by: Jai Radhakrishnan <[email protected]>
chroma-droid pushed a commit that referenced this pull request Nov 3, 2025
…bedding (#5787)

## Description of changes

_Summarize the changes made by this PR._

- Improvements & Bug fixes
- There is a bug in schema where is_default_schema does not check the
space when confirming if the schema is default. This was hidden by our
e2e tests, since we used an ef with a default space of cosine. therefore
the configuration was cosine and was automatically converted into the
schema and tests passed. this PR adds a new test to confirm the basic
space setting scenario works
- New functionality
  - ...

## Test plan

_How are these changes tested?_

- [ ] 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](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
sanketkedia pushed a commit that referenced this pull request Nov 3, 2025
This PR cherry-picks the commit a22959d
onto rc/2025-10-31. If there are unresolved conflicts, please resolve
them manually.

Co-authored-by: Jai Radhakrishnan <[email protected]>
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