Python 3.13/3.14 SyntaxWarning in v1 LogsPipelinesApi docstring
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with src/datadog_api_client/v1/api/logs_pipelines_api.py and inspect the LogsPipelinesApi class docstring around the reported regex text. Run the supplied Python command with warnings enabled to reproduce the warning, then verify that importing the module no longer emits it. Done means the offending sequence is represented safely and the import remains successful.
Written by the indexing model from the issue text.
Description
Describe the bug
Importing datadog_api_client.v1.api.logs_pipelines_api emits a SyntaxWarning on Python 3.13+ because the LogsPipelinesApi class docstring contains an unescaped regex sequence: \s.
The warning appears to come from this docstring text in src/datadog_api_client/v1/api/logs_pipelines_api.py:
that uses a regex pattern like ``\s`` for spaces, you will
Because Python docstrings are normal string literals, \s is parsed as an invalid escape sequence. Escaping it as \\s or generating the docstring as a raw string should avoid the warning.
To Reproduce
Run this with warnings enabled on Python 3.13 or 3.14:
python -W default -c "from datadog_api_client.v1.api.logs_pipelines_api import LogsPipelinesApi; print(ok)"
Observed output:
.../datadog_api_client/v1/api/logs_pipelines_api.py:38: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
"""
ok
Expected behavior
Importing the SDK module should not emit warnings.
Screenshots
Not applicable.
Environment and Versions (please complete the following information):
datadog-api-client: observed locally with2.54.0- Python: reproduced locally with
Python 3.14.0rc2; expected to affect Python 3.13+ warning behavior - Module:
datadog_api_client.v1.api.logs_pipelines_api - Repository
masterchecked on 2026-05-17 still contains the same unescaped docstring sequence - Latest PyPI version observed on 2026-05-17:
2.55.0
Additional context
This surfaced when importing CLI code that depended on the Logs Pipelines API. The workaround on our side was to lazy-load this SDK module so unrelated CLI invocations do not emit SDK import warnings, but the underlying issue appears to be in the generated SDK docstring.
- Dominant language
- Python
- Stars
- 166
- Forks
- 55
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 73
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/datadog-api-client-python
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 66/100
DataDog/datadog-api-client-python#3717 · 3 comments ·
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 75/100
DataDog/datadog-api-client-python#3656 · 1 comment ·
-
kind/bug stale
Difficulty 3/5 1-2 days Newbie friendliness 38/100
DataDog/datadog-api-client-python#3120 · 1 comment ·
-
stale
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DataDog/datadog-api-client-python#2986 · 1 comment ·
-
kind/feature-request stale
Difficulty 5/5 Over a week Newbie friendliness 20/100
DataDog/datadog-api-client-python#2878 · 3 comments ·
All issues in DataDog/datadog-api-client-python
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·