elastic / curator

Curator: Tending your Elasticsearch indices
Other
3.04k stars 635 forks source link

Fix unescaped characater error in docstring #1712

Closed idanceinbetween closed 4 months ago

idanceinbetween commented 4 months ago

There is an unescaped character in the docstring of indexlist module which has been deprecated since Python 3.6.

This causes an issue during pytest's test collection phase when running tests on modules that import curator as a library on later versions of Python: "SyntaxError: invalid escape sequence '\d'"

In popular python linters e.g. ruff and flake8 this violates rule W605.

Upon linting the entire source code, this is the only file that has this rule violation. This commit fixes this error. LintForW605

The change has been tested by modifying a local copy of the library and running my test suite that originally failed against it, and the exception no longer occurs.

Proposed Changes

untergeek commented 4 months ago

Thank you for this. I just patched this in the master, 8.x, and 8.0 branches as well. I have a lot of tech debt with the 7.x branch that is just hanging there.

idanceinbetween commented 4 months ago

Thank you for this. I just patched this in the master, 8.x, and 8.0 branches as well. I have a lot of tech debt with the 7.x branch that is just hanging there.

Ah yes, I have just seen it on the later branches. Unfortunately we cannot yet upgrade to 8.0 so would be fab to have at least this patched for 7.x too. Is there anything else that would be useful to get this approved, merged and released?

idanceinbetween commented 4 months ago

Hi @untergeek , can this PR be approved please?

untergeek commented 4 months ago

Sorry for the long delay. I've been super busy.

idanceinbetween commented 4 months ago

No worries - thank you for this!