Skip to content

docs(genai-util): fix the docstring that breaks the docs build - #295

Open
pylaterreur wants to merge 2 commits into
alibaba:mainfrom
pylaterreur:fix-docs-monotonic-first-token-warning
Open

pylaterreur wants to merge 2 commits into
alibaba:mainfrom
pylaterreur:fix-docs-monotonic-first-token-warning

Conversation

@pylaterreur

Copy link
Copy Markdown
Contributor

Description

Since #294, the docs job fails on every pull request. sphinx-build -W stops on docstring of opentelemetry.util.genai.extended_types.InvokeAgentInvocation.monotonic_first_token_s:3: py:class reference target not found: Streaming. It failed on #294 itself as well. The job only runs on pull requests, so main shows green.

#294 added extended_types to the API docs. Napoleon reads the first line of an attribute docstring written as Name: text as type: description, so the Streaming: prefix became a reference to a Streaming class, which nitpicky mode reports. This PR rewords the docstring.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Full docs build, sphinx-build -E -a -W --keep-going -b html -T . _build/html, with the docs env's packages on GitHub CPython 3.11:

  • on main: 2 warnings, the Streaming one and No module named 'MySQLdb';
  • with this PR: only the MySQLdb one.

The MySQLdb warning is local: mysqlclient can't be built without the MySQL client headers, which my machine lacks and CI has. tox -e precommit passes.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

🤖 Generated with Claude Code

https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN

🤖 Generated with Claude Code

https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN

alibaba#294 added extended_types to the API docs. Napoleon reads the first
line of an attribute docstring written as "Name: text" as "type:
description", so the "Streaming:" prefix of
InvokeAgentInvocation.monotonic_first_token_s became a py:class
reference to "Streaming". Nitpicky mode reports it and -W makes it an
error, so the docs job fails on every pull request since alibaba#294. Reword
the docstring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
@pylaterreur

Copy link
Copy Markdown
Contributor Author

@sipercai @ralf0131 this fixes the docs job that fails on every pull request since #294 (it failed on #294 itself; the job only runs on PRs, so main looks green). #296 fixes the google-genai-latest jobs that went red with google-genai 2.34.0 on main. Could you review these two first? Both are small.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN

google-genai 2.34.0 (2026-10-29) adds automatic continuation to
interactions.create. The public create now merges the hops it sends,
even a single one, into a copy of the interaction made with
model_copy(update=...), for the interaction and for its usage. The
tests return MagicMock interactions from the generated create, and
MagicMock().model_copy() is a new mock without the configured fields,
so test_instrumentation_does_not_break_core_functionality got a mock id.

The instrumentation is unaffected: it wraps the generated create and
reads each hop's response, as before. With real objects over a mocked
HTTP API, a single-hop interaction gives the same object and span on
2.33.0 and 2.34.0, and an interaction continued over two hops gives one
span per request.

Mock the interaction and its usage as pydantic-like models whose
model_copy keeps their fields.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
@pylaterreur

Copy link
Copy Markdown
Contributor Author

Thanks for the approval. Each of #295 and #296 failed on the other's problem (docs here, google-genai there), so neither could go green alone. I added #296's commit here and this PR's commit to #296 (same content). Merging either one makes the other's duplicate commit empty, so either order works.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN

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.

4 participants