databricks-sdk-py
databricks-sdk-py copied to clipboard
[ISSUE] DeprecationWarning: invalid escape sequence '\.'
Description https://github.com/databricks/databricks-sdk-py/blob/a558d97415e8ced4b88c70e03e0a31f4f2006610/databricks/sdk/service/jobs.py#L61C30-L61C30 the backslash before the period in the docstring throws the following warning. DeprecationWarning: invalid escape sequence '.'.
Reproduction Run the following code through pytest or something.
"""The sequence number of this run attempt for a triggered job run. The initial attempt of a run
has an attempt_number of 0\. If the initial run attempt fails, and the job has a retry policy
(`max_retries` \> 0), subsequent runs are created with an `original_attempt_run_id` of the
original attempt’s ID and an incrementing `attempt_number`. Runs are retried only until they
succeed, and the maximum `attempt_number` is the same as the `max_retries` value for the job."""
Expected behaviour Not receiving a warning.
Is it a regression? Didn't check.
Other Information
- OS: Linux.
- Python: 3.10.
- Version: latest.
Thanks for raising this, we will take a look.
As of python 3.12, this DeprecationWarning is now raised by the language itself, as a SyntaxWarning. https://docs.python.org/3/whatsnew/3.12.html#other-language-changes . So, I can confirm the existence of the issue as well :).
Seems like an easy fix. Either double the backslash or use a raw string, I suppose.
I think this was probably closed by https://github.com/databricks/databricks-sdk-py/commit/fb30ed98912a4e62a4b535188765f792b7bc6f47#diff-9125abd285f0b94b52f0445f9f85a75a921fae47124d670ab9f8f822de9f33acL61