Skip to content

fix: remove the remaining invalid escape sequence warnings - #1029

Open
enekoreto wants to merge 1 commit into
apache:mainfrom
enekoreto:fix/invalid-escape-sequences
Open

enekoreto wants to merge 1 commit into
apache:mainfrom
enekoreto:fix/invalid-escape-sequences

Conversation

@enekoreto

Copy link
Copy Markdown
Contributor

Two strings still give SyntaxWarning: invalid escape sequence on Python 3.12+. The b_psycopg2.py one shows up in CI's test-persister-dbs job on main. Future Python versions plan to make it an error.

Changes

  • b_psycopg2.py: the PostgreSQLPersister docstring has '\ ' in its docker example (line 41), so it's now a raw string.
  • s3client.py: allowed_chars = r"a-zA-Z0-9_\-" in _allowed_project_name (line 101), the same fix b7547ed made in burr/tracking/client.py. The S3 client was added a few days before that and kept the old line.

How I tested this

  • Compiled every .py file in the repo with warnings on: 2 SyntaxWarnings on main, none here.
  • The docstring and allowed_chars are identical before and after, and _allowed_project_name gives the same result on main and here for a set of project names, with and without Windows.
  • Full test suite and pre-commit pass, on Python 3.13 and 3.10.

Notes

Both strings keep exactly the same value, so the only change is the missing warning.

This was done with AI assistance (Claude Code), and checked by running the tests described above.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@github-actions github-actions Bot added area/storage Persisters, state storage area/tracking Telemetry, tracing, OpenTelemetry area/integrations External integrations (LLMs, frameworks) labels Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/integrations External integrations (LLMs, frameworks) area/storage Persisters, state storage area/tracking Telemetry, tracing, OpenTelemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant