Skip to content

Fix docstring cross-references that Sphinx 9 cannot resolve - #74169

Open
shahar1 wants to merge 2 commits into
apache:mainfrom
shahar1:docs-sphinx9-docstring-fixes
Open

shahar1 wants to merge 2 commits into
apache:mainfrom
shahar1:docs-sphinx9-docstring-fixes

Conversation

@shahar1

@shahar1 shahar1 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

related: #74151
related: #74168

AI Summary

Moving the docs build to Python 3.11 (#74151) moves it from Sphinx 8.1.3 to Sphinx 9.0.4, which resolves annotation and field types project-wide. That turns a few long-standing docstring mistakes into ambiguous or broken references that fail the docs and spellcheck jobs:

  • google vertex_ai/auto_ml.py: :param budget_milli_node_hours (int): is not a valid field; Sphinx read budget_milli_node_hours as a type name and matched the operators' attributes of that name.
  • google compute.py: three methods documented :rtype: object although their signatures already return InstanceTemplate, Instance and InstanceGroupManager; the field is removed so the real annotation is rendered. The two class names are added to the spelling wordlist next to the other Compute class names.
  • amazon executors/batch/utils.py: CommandType and the alias target WorkloadKey matched the same-named aliases in the ECS and Lambda executors. CommandType is now annotated as a TypeAlias like theirs (so it resolves in its own module), and the core WorkloadKey is imported under the module-unique name _BatchWorkloadKey, as the ECS executor does with _EcsWorkloadKey (reusing the Lambda executor's _WorkloadKey would collide as a duplicate object on Sphinx 8).
  • task-sdk deferred-vs-async-operators.rst: :doc: used an airflow: inventory prefix that does not exist; every other cross-package link uses apache-airflow:.

The builtin type/object warnings are an upstream Sphinx regression and are handled in #74168.

Checks run: amazon --docs-only passes on both Python 3.10 / Sphinx 8.1.3 and Python 3.11 / Sphinx 9.0.4; with both PRs applied, --docs-only for amazon, google, openlineage and task-sdk passes on Python 3.11 / Sphinx 9.0.4, and google spellcheck passes; Breeze mypy on the changed amazon and google modules passes on Python 3.11.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5.5)

Generated-by: Claude Code (Opus 5.5) following the guidelines

🤖 Generated with Claude Code

https://claude.ai/code/session_01SkLWWaTT1cnFqTT1jhFGxe

Sphinx 9 resolves annotation and field types project-wide, which turns
a few long-standing docstring mistakes into ambiguous or broken
references: a parameter field written as ":param name (int):", return
types documented as "object" where the signature already names the real
class, batch executor aliases whose names clash with the ECS and Lambda
executor aliases, and a Task SDK link to an intersphinx inventory name
that does not exist.

Claude-Session: https://claude.ai/code/session_01SkLWWaTT1cnFqTT1jhFGxe
Sphinx 8 registers the canonical target of a documented type alias as
an object. Importing the core WorkloadKey as _WorkloadKey in the batch
executor made its canonical name identical to the Lambda executor's, so
the Sphinx 8 docs build failed with a duplicate object description.
Sphinx 9 no longer reports that, which is why it only showed up on
Python 3.10.

Claude-Session: https://claude.ai/code/session_01SkLWWaTT1cnFqTT1jhFGxe
@shahar1
shahar1 force-pushed the docs-sphinx9-docstring-fixes branch from 9268447 to 780b065 Compare October 3, 2026 20:01

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

area:providers area:task-sdk provider:amazon AWS/Amazon - related issues provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants