Skip to content

docs: improve Boost API docstrings (consistency, clarity, accuracy)#2057

Merged
dirkkul merged 3 commits into
dev/1.38from
docs/boost-api-docstrings
Jun 17, 2026
Merged

docs: improve Boost API docstrings (consistency, clarity, accuracy)#2057
dirkkul merged 3 commits into
dev/1.38from
docs/boost-api-docstrings

Conversation

@g-despot

Copy link
Copy Markdown
Contributor

What

Improves the docstrings for the Boost API (added in #2030) for consistency, clarity, and factual accuracy. Docstrings only — no signature or behavior changes. Targets dev/1.38 since the Boost surface lives there.

Changes

  • boost= is now documented in the Args: of all 14 query + generate methods (hybrid, near_text, near_object, near_vector, near_image, near_media, bm25). It was present in every signature but documented in none.
  • Corrected defaults/semantics to match server behavior:
    • weight: blend weight in [0, 1], default 0.5; final score = (1 - weight)·primary + weight·boost; 0 is a no-op
    • depth: the candidate pool the primary search overfetches and re-sorts, default 100
    • curve defaults to exp; decay value range (0, 1], default 0.5; offset default 0
    • blend: per-condition weight default 1.0 (may be negative to demote); max 20 conditions
  • Unified terminology (boost / re-score; avoids confusion with the separate rerank= feature) and added Attributes: blocks for the Curve and Modifier enums.

Verification

All documented defaults, the blend formula, the 20-condition cap, and the filter() operator allowlist were verified against the server implementation. python -m py_compile passes on all edited files.

🤖 Generated with Claude Code

Polish the docstrings for the Boost API (the Boost class, its factory
methods, the Curve/Modifier enums, and the boost= parameter):

- Document the boost= parameter in the Args of all 14 query and generate
  methods (hybrid, near_text, near_object, near_vector, near_image,
  near_media, bm25). It was present in every signature but documented in
  none.
- Correct the documented defaults and semantics to match server
  behavior: weight (blend weight in [0, 1], default 0.5,
  (1 - weight)*primary + weight*boost, 0 is a no-op), depth (the
  overfetched candidate pool, default 100), curve (default exp), decay
  value (range (0, 1], default 0.5), offset (default 0), and blend's
  per-condition weight (default 1.0, may be negative) plus the
  20-condition cap.
- Unify terminology and add Attributes blocks describing the Curve and
  Modifier enum members.

Docstrings only -- no API or behavior changes. Defaults verified against
the server implementation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@codecov-commenter

codecov-commenter commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (dev/1.38@cccff14). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             dev/1.38    #2057   +/-   ##
===========================================
  Coverage            ?   86.60%           
===========================================
  Files               ?      300           
  Lines               ?    23129           
  Branches            ?        0           
===========================================
  Hits                ?    20031           
  Misses              ?     3098           
  Partials            ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

g-despot and others added 2 commits June 16, 2026 11:54
Replace flowery phrasing ("span many orders of magnitude",
"long-tail dampening") with plain language describing what the
LOG1P/SQRT modifiers do.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep the boost= Args entry to a single sentence. The Boost factory
methods (filter/time_decay/numeric_decay/numeric_property/blend) are
already listed on the Boost class docstring, so repeating them on all
14 query/generate executors was redundant.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

This pull request improves the Python client’s Boost API documentation to make the boost= query/generate parameter discoverable and to clarify Boost behavior (semantics, defaults, and terminology) without changing any runtime behavior. It updates docstrings across the query executors and the Boost-related enums/factories in weaviate/collections/classes/grpc.py.

Changes:

  • Documented boost= in the Args: section for the relevant query and generate executor methods.
  • Expanded and clarified Boost API docstrings in weaviate/collections/classes/grpc.py, including Curve / Modifier enum attribute descriptions and more explicit parameter semantics.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
weaviate/collections/queries/near_vector/query/executor.py Adds boost to the near_vector query method docstring args.
weaviate/collections/queries/near_vector/generate/executor.py Adds boost to the near_vector generate method docstring args.
weaviate/collections/queries/near_text/query/executor.py Adds boost to the near_text query method docstring args.
weaviate/collections/queries/near_text/generate/executor.py Adds boost to the near_text generate method docstring args.
weaviate/collections/queries/near_object/query/executor.py Adds boost to the near_object query method docstring args.
weaviate/collections/queries/near_object/generate/executor.py Adds boost to the near_object generate method docstring args.
weaviate/collections/queries/near_media/query/executor.py Adds boost to the near_media query method docstring args.
weaviate/collections/queries/near_media/generate/executor.py Adds boost to the near_media generate method docstring args.
weaviate/collections/queries/near_image/query/executor.py Adds boost to the near_image query method docstring args.
weaviate/collections/queries/near_image/generate/executor.py Adds boost to the near_image generate method docstring args.
weaviate/collections/queries/hybrid/query/executor.py Adds boost to the hybrid query method docstring args.
weaviate/collections/queries/hybrid/generate/executor.py Adds boost to the hybrid generate method docstring args.
weaviate/collections/queries/bm25/query/executor.py Adds boost to the bm25 query method docstring args.
weaviate/collections/queries/bm25/generate/executor.py Adds boost to the bm25 generate method docstring args.
weaviate/collections/classes/grpc.py Expands Boost-related docstrings for clarity/consistency, including Curve/Modifier enum docs and Boost factory method docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dirkkul dirkkul merged commit 6b6dac6 into dev/1.38 Jun 17, 2026
122 of 123 checks passed
@dirkkul dirkkul deleted the docs/boost-api-docstrings branch June 17, 2026 04:31
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.

5 participants