Skip to content

Conversation

@tanujnay112
Copy link
Contributor

@tanujnay112 tanujnay112 commented Dec 5, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • As titled, add a collection metadata entry to all output collections. Using this, we prevent attaching functions to collections that were made as a result of functions.
  • 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?

@github-actions
Copy link

github-actions bot commented Dec 5, 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

tanujnay112 commented Dec 5, 2025

@tanujnay112 tanujnay112 changed the title feat: add output collection metadata and prevent attaching to output collections [ENH]: Add collection metadata to output collection to identify source attached function Dec 5, 2025
@tanujnay112 tanujnay112 marked this pull request as ready for review December 5, 2025 02:41
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Dec 5, 2025

Add metadata flag to output collections and block function chaining

The PR introduces metadata tagging for attached-function output collections and uses that marker to prevent attaching another function to the same collection. It also wires the new error through the coordinator, updates constants, and adds regression coverage in Go and Python tests to validate the new guard.

Key Changes

• Set common.SourceAttachedFunctionIDKey metadata on output collections created in FinishCreateAttachedFunction
• Add guard in Coordinator.AttachFunction to return common.ErrCannotAttachToOutputCollection when the input collection carries the output metadata
• Expose the new ErrCannotAttachToOutputCollection constant in go/pkg/common/errors.go and go/pkg/common/constants.go
• Extend coordinator_test.go and chromadb/test/distributed/test_task_api.py with scenarios covering the new restriction

Affected Areas

go/pkg/sysdb/coordinator/task.go
go/pkg/sysdb/coordinator/coordinator_test.go
chromadb/test/distributed/test_task_api.py
go/pkg/common/errors.go
go/pkg/common/constants.go

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

@tanujnay112 tanujnay112 force-pushed the tnayak/output-collection-metadata branch from f782230 to 3acb2ad Compare December 5, 2025 03:21
…collections

- Add chroma:attached_function_id metadata when creating output collections
- Add check in AttachFunction to prevent attaching functions to output collections
- Add ErrCannotAttachToOutputCollection error
@tanujnay112 tanujnay112 force-pushed the tnayak/output-collection-metadata branch from 3acb2ad to dbbe74c Compare December 5, 2025 03:23

// SourceAttachedFunctionIDKey is the metadata key used to mark output collections
// and link them to their attached function.
SourceAttachedFunctionIDKey = "chroma:source_attached_function_id"
Copy link
Contributor

Choose a reason for hiding this comment

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

Which reads better:

  • "source attached function id"
  • "attached function id source"

@tanujnay112 tanujnay112 merged commit 9404d46 into main Dec 8, 2025
122 of 124 checks passed
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