Skip to content

Fix duplicate docstring attributes in Measurement and Exemplar classes#4920

Open
chimchim89 wants to merge 1 commit intoopen-telemetry:mainfrom
chimchim89:fix-duplicate-docstring-attributes
Open

Fix duplicate docstring attributes in Measurement and Exemplar classes#4920
chimchim89 wants to merge 1 commit intoopen-telemetry:mainfrom
chimchim89:fix-duplicate-docstring-attributes

Conversation

@chimchim89
Copy link

@chimchim89 chimchim89 commented Feb 18, 2026

Description

Fixes the duplicate attribute documentation caused by both napoleon and autodoc Sphinx extensions processing the same Attributes: sections in dataclass docstrings. This was flagged by TODO comments in both files referencing sphinx-doc/sphinx#8664.

Changes:

  • docs/conf.py: Add napoleon_use_ivar = True so napoleon emits :ivar: fields instead of .. attribute:: directives, preventing autodoc from rendering the same attributes a second time
  • measurement.py: Fix missing colon in Attributes: section and remove TODO comment
  • exemplar.py: Fix missing colon in Attributes: section and remove TODO comment

Fixes # (no issue — fixing existing TODO comments in the codebase)

Type of change

  • This change requires a documentation update

How Has This Been Tested?

Ran tox -e docs and tox -e ruff locally.

  • tox -e ruff passes cleanly after auto-fix of trailing whitespace
  • tox -e docs fails on both main and this branch with the same pre-existing unrelated error in opentelemetry._logs._internal.LogRecord (ambiguous cross-reference for Context). This is not caused by this PR.

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

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

@chimchim89 chimchim89 requested a review from a team as a code owner February 18, 2026 10:26
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 18, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: chimchim89 / name: Achal (a9b255a)

@tammy-baylis-swi tammy-baylis-swi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 18, 2026
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Thanks for this. Maintainers will also review

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

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants

Comments