[WIP] Render API doc markdown as native RST in docstrings#1474
Open
tanmay-db wants to merge 1 commit into
Open
[WIP] Render API doc markdown as native RST in docstrings#1474tanmay-db wants to merge 1 commit into
tanmay-db wants to merge 1 commit into
Conversation
Regenerated service docstrings with genkit's new docfmt renderer, which parses spec descriptions as CommonMark and emits Sphinx-native RST instead of leaking raw markdown: - inline backticks -> ``double-backtick`` literals - fenced code examples -> .. code-block:: directives - markdown links -> anonymous RST hyperlinks - bullet/numbered lists -> proper RST lists (previously broken by word-wrap, leaving list markers dangling mid-line) - stray lone list markers (proto-comment artifacts) are dropped instead of rendering an empty list Generated from the same OpenAPI spec the SDK is current with, so the diff is docstring-only: code is AST-identical to main for all 33 files. Formatted with the repo's pinned ruff 0.5.6 (make fmt equivalent). Co-authored-by: Isaac
cc67e34 to
7f90f2d
Compare
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Regenerates service docstrings with the SDK generator's new doc renderer, which parses OpenAPI spec descriptions as CommonMark and emits Sphinx-native RST instead of copying raw markdown through. Docstring-only change: code is AST-identical to
mainin all 33 files.Why
Spec descriptions are written in markdown, but Python docstrings are rendered by Sphinx as RST. The generator previously copied the markdown through verbatim (with word-wrapping), so the published SDK docs show literal backticks instead of code formatting, bullet lists broken by wrapping (
*markers dangling mid-line), multi-line code examples collapsed onto one line, and unresolved[text]: urlreference links. This PR applies the new renderer's output for the spec revision the SDK is already on, so the diff contains only documentation fixes — no API changes.Before → After examples
1. Inline code and bullet lists — before:
jobs.pyL282–L284 onmain(live rendering today: note the italics instead of code formatting and the dangling*at the end of the first line) → after:jobs.pyL288–L290Before (word-wrap left the second bullet's
*dangling at the end of the first line; single backticks render as italics in RST, not code):After (proper RST list with hanging indent; double-backtick literals):
2. Code examples — before:
sql.pyL9533–L9535 onmain(live rendering today: under theformatparameter, the CSV example is a single garbled line) → after:sql.pyL9542–L9553Before (the fenced CSV example was word-wrapped onto a single line, destroying it):
After (a real
.. code-block::directive Sphinx renders as a code box):3. Links — before:
sql.pyL9527 + orphan definition at L9537 onmain(live rendering today: same page,[Apache Arrow streaming format].appears as literal bracketed text with the bare URL definition below) → after:sql.pyL9537–L9539Before (markdown reference link never resolves in RST; the URL definition dangles at the bottom of the docstring):
After (RST anonymous hyperlink, rendered as a real link):
What changed
Interface changes
None.
Behavioral changes
None — docstring text only. Every changed file is AST-identical to
mainonce docstrings (including PEP 257 attribute docstrings) are stripped.Internal changes
databricks/sdk/service/(plusAccountClient/WorkspaceClientmethod docs) from the same OpenAPI spec revision the SDK is currently on.bundledeployments.py,database.py, andpostgres.pyare intentionally excluded:mainlags the spec slightly there, and including them would pull API changes into this docs-only diff. They will pick up the new doc rendering with the next regular spec bump.ruff==0.5.6(make fmtequivalent).How is this tested?
mainand on this branch was parsed, all docstrings stripped, and the remaining code compared — identical for all 33 files, confirming a docs-only diff... code-block::directives, anonymous hyperlinks, and list formatting (examples linked above).Note for sequencing: this should merge after the generator-side change lands, so the next automated regeneration preserves (rather than reverts) these docstrings.
This pull request and its description were written by Isaac.