Skip to content

[NA] [SDK] docs: document entrypoint/environment args and fix garbled task_threads docstring - #8165

Open
simpleqt wants to merge 1 commit into
comet-ml:mainfrom
simpleqt:docs/document-environment-and-entrypoint-args
Open

[NA] [SDK] docs: document entrypoint/environment args and fix garbled task_threads docstring#8165
simpleqt wants to merge 1 commit into
comet-ml:mainfrom
simpleqt:docs/document-environment-and-entrypoint-args

Conversation

@simpleqt

@simpleqt simpleqt commented Sep 4, 2026

Copy link
Copy Markdown

Details

Docstring-only fix in the Python SDK: BaseTrackDecorator.track() documented neither entrypoint nor environment (both real keyword parameters), Opik.trace() documented neither environment nor its fallback to the client-configured environment, and the task_threads docstring in evaluator.py (both evaluate() and evaluate_dataframe()/variant) contained a duplicated, broken sentence from two merged revisions. No behavior change.

Change checklist

  • User facing
  • Documentation update

Issues

  • Resolves #
  • OPIK-

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: ZCode (AI coding agent)
  • Model(s): GLM
  • Scope: docstring/signature cross-check over sdks/python; wording for the two new Args entries follows the surrounding style; the environment fallback wording mirrors the actual if environment is None: environment = self._config.environment logic
  • Human verification: yes — every claimed-missing parameter was checked against its signature

Testing

python3 -m compileall on the three touched files passes. Docstring-only; no tests assert these texts.

Documentation

Docstrings feed the published SDK API reference, which is the point of the fix.

… task_threads docstring

- BaseTrackDecorator.track documented neither entrypoint nor
  environment, both of which are real keyword parameters
- Opik.trace documented neither environment nor its fallback to the
  client-configured environment
- evaluator task_threads docstring had a duplicated, broken sentence
  from two merged revisions
@simpleqt
simpleqt requested a review from a team as a code owner September 4, 2026 15:51
Copilot AI lite review requested due to automatic review settings September 4, 2026 15:51
@github-actions github-actions Bot added python Pull requests that update Python code Python SDK 🔵 size/XS labels Sep 4, 2026

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.

🟢 Approval recommended

Changes are docstring-only, align with existing function signatures/behavior, and don’t modify runtime logic.

Pull request overview

Updates Python SDK docstrings to accurately reflect existing keyword parameters and to fix a duplicated/garbled docstring sentence, improving the generated API reference without changing runtime behavior.

Changes:

  • Document entrypoint and environment kwargs for BaseTrackDecorator.track().
  • Document environment (including fallback behavior) for Opik.trace().
  • Fix duplicated/broken wording in task_threads docstrings in evaluator entrypoints.
File summaries
File Description
sdks/python/src/opik/evaluation/evaluator.py Cleans up duplicated task_threads docstring wording in evaluation APIs.
sdks/python/src/opik/decorator/base_track_decorator.py Adds missing docstring entries for entrypoint and environment kwargs.
sdks/python/src/opik/api_objects/opik_client.py Adds missing environment docstring entry and documents fallback behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +95 to +96
entrypoint: Whether the decorated function is an entrypoint. Entrypoints
are shown separately in the Opik UI.

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.

Entrypoints are not separately shown

The entrypoint docs promise separate Opik UI entries, but the UI renders and submits only agents[0], so decorating multiple functions hides every entrypoint after the first — should we add per-agent rendering/selection or revise the documentation?

Severity

Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`sdks/python/src/opik/decorator/base_track_decorator.py` around lines 95-96, update the
`BaseTrackDecorator.track` docstring’s `entrypoint` description. It incorrectly
promises that entrypoints are shown separately in the Opik UI, even though the current
UI only exposes the first registered agent. Remove that promise and document only the
actual entrypoint/registration behavior, unless the implementation is also being changed
to support per-entrypoint UI selection.

Comment on lines +97 to +98
environment: The environment in which the trace was created, e.g. 'production'
or 'development'. Defaults to the configured environment when not set.

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.

Document nested environment precedence

resolve_child_span_environment always returns the enclosing environment, so nested @track calls record an explicit child environment as the parent’s value — should we document this parent-context precedence in the environment argument?

Severity

Want Baz to fix this for you? Activate Fixer You can also update your AI coding guidelines based on this comment by apply pr to [branch name]

Other fix methods

Fix in Cursor

Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
`sdks/python/src/opik/decorator/base_track_decorator.py` around lines 97-98, update the
`BaseTrackDecorator.track` method’s `environment` argument documentation to state that
nested `@track` spans inherit the enclosing parent environment and an explicit child
value does not override it. Mention that the configured environment is used only when no
parent context provides one, aligning the docs with `resolve_child_span_environment`
behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python SDK python Pull requests that update Python code 🔵 size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants