Skip to content

Escape backslashes in generated docstrings#3566

Draft
Mirochill wants to merge 1 commit into
DataDog:masterfrom
Mirochill:fix-3535-docstring-backslashes
Draft

Escape backslashes in generated docstrings#3566
Mirochill wants to merge 1 commit into
DataDog:masterfrom
Mirochill:fix-3535-docstring-backslashes

Conversation

@Mirochill

@Mirochill Mirochill commented May 21, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #3535.

Generated API docstrings can include literal backslashes from OpenAPI descriptions. When those backslashes are written directly into Python triple-quoted docstrings, Python 3.13+ can emit SyntaxWarning for invalid escape sequences such as \s.

This updates the generator docstring formatter so rendered backslashes are escaped for Python string literals, adds a formatter regression for a regex-style \s example, and updates the currently affected generated LogsPipelinesApi docstring.

Additional Notes

Not run locally.

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in the last 30 days.
If there is no activity for another 90 days, this issue will be automatically closed.

@github-actions github-actions Bot added the stale label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3.13/3.14 SyntaxWarning in v1 LogsPipelinesApi docstring

1 participant