Skip to content

[BUG]: drop task from required-field guard in Qwen EF build_from_config (#7450) - #7473

Open
rkfshakti wants to merge 2 commits into
chroma-core:mainfrom
rkfshakti:fix/qwen-ef-build-from-config-task-none
Open

rkfshakti wants to merge 2 commits into
chroma-core:mainfrom
rkfshakti:fix/qwen-ef-build-from-config-task-none

Conversation

@rkfshakti

Copy link
Copy Markdown
Contributor

Problem

ChromaCloudQwenEmbeddingFunction treats task as optional everywhere except build_from_config, so a collection whose Qwen embedding function was created with task=None cannot be reloaded.

  • The constructor signature is task: Optional[str], and the docstring says "If None or empty, empty instructions will be used"
  • The runtime (__call__ / embed_query) handles task=None (if self.task and ...)
  • The JSON schema schemas/embedding_functions/chroma-cloud-qwen.json declares "task": {"type": ["string", "null"]}
  • get_config() emits {"task": None, ...} for such an EF, and validate_config() accepts it

But build_from_config guarded with if model is None or task is None: assert False, so reloading a persisted collection whose Qwen EF used task=None raises AssertionError, which load_collection_configuration_from_json re-wraps as ValueError("Could not build embedding function ...") — the collection becomes unusable.

Fix

Only model is actually required; drop task from the guard:

-        if model is None or task is None:
+        if model is None:
             assert False, "Config is missing a required field"

Test

Added a real (non-mocked) get_config → build_from_config round-trip regression test (TestQwenEmbeddingFunctionTaskNone.test_build_from_config_with_task_none). The existing parametrized round-trip test mocks build_from_config, so it never exercised this path.

Fixes #7450

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions

Copy link
Copy Markdown

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)

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Hi maintainers — gentle bump on this fix for #7450. Drops task from the required-field guard in QwenEmbeddingFunction.build_from_config so collections with task=None can be loaded. Ready for review. Thanks!

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Hi maintainers — circling back on this fix for #7450. Would love to hear if dropping task from the required-field guard in build_from_config is the right call, or if there's a better approach. Happy to adjust. Keen to contribute! Thanks.

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Friendly ping — this PR has been open for a couple of days with CI passing. Would appreciate a review when time allows.

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Hi maintainers — following up again on this fix for #7450. Drops task from the required-field guard in Qwen EF build_from_config. CI is green. Would appreciate a review when time allows. Thanks!

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Friendly ping — this PR has been open for over 10 days with all CI green. Would appreciate a review when time allows.

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Hi maintainers — this PR has been open for over 2 weeks with all CI green. The fix drops task from the required-field guard in Qwen EF build_from_config (#7450). Would appreciate a review when time allows.

@rkfshakti

Copy link
Copy Markdown
Contributor Author

Friendly ping — this PR has been open for over a week. CI is green and the fix is minimal. Would appreciate a review when time allows. Thanks!

@rkfshakti rkfshakti changed the title fix: drop task from required-field guard in Qwen EF build_from_config (#7450) [BUG]: drop task from required-field guard in Qwen EF build_from_config (#7450) Aug 18, 2026
@rkfshakti
rkfshakti force-pushed the fix/qwen-ef-build-from-config-task-none branch 4 times, most recently from 41bdf7d to 32f48a0 Compare September 19, 2026 15:52
@rkfshakti
rkfshakti force-pushed the fix/qwen-ef-build-from-config-task-none branch from 32f48a0 to b000869 Compare September 23, 2026 16:31
@rkfshakti

Copy link
Copy Markdown
Contributor Author

Friendly review ping — drops task from the required-field guard in the Qwen EF build_from_config (#7450). CI green on current head b000869c, ~75 days quiet. Would appreciate a look when convenient; happy to rebase if main has moved.

@rkfshakti
rkfshakti force-pushed the fix/qwen-ef-build-from-config-task-none branch from b000869 to f438bf1 Compare October 20, 2026 15:09
@rkfshakti
rkfshakti force-pushed the fix/qwen-ef-build-from-config-task-none branch from f438bf1 to 92521f6 Compare October 29, 2026 02:53
…chroma-core#7450)

The constructor accepts task=None, the runtime handles task=None, the JSON
schema permits task=null, and get_config emits task=None — but build_from_config
guarded with 'if model is None or task is None: assert False', making it
impossible to reload a persisted collection whose Qwen EF used task=None.

Only model is actually required; drop task from the guard.
@rkfshakti
rkfshakti force-pushed the fix/qwen-ef-build-from-config-task-none branch from 92521f6 to 7c8989f Compare November 8, 2026 10:22

This branch has not been deployed

No deployments
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.

ChromaCloudQwenEmbeddingFunction.build_from_config rejects task=None that get_config() emits

1 participant