Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified regex example to fix invalid escape strings warning #1164

Merged

Conversation

17jmumford
Copy link
Contributor

@17jmumford 17jmumford commented Jan 28, 2025

Details

The regex example in regex_match.py was using \d in a regular string, which triggers a Python SyntaxWarning: invalid escape sequence '\d' when running an application using Opik. This warning occurs because Python interprets backslashes in regular strings as escape sequences, and \d is not a valid escape sequence.

Issues

Resolves #1163

Testing

This change properly escapes the backslashes in the regular string while maintaining identical regex matching functionality. The double backslash ensures Python correctly passes a single backslash to the regex engine.

  • Verified that the warning no longer appears when running the application
  • Confirmed that the regex pattern continues to match the same strings as before. Doesn't really matter since it's just an example

@17jmumford 17jmumford requested a review from a team as a code owner January 28, 2025 21:06
@17jmumford 17jmumford changed the title modified regex example to remove invalid escape strings modified regex example to fix invalid escape strings warning Jan 28, 2025
@alexkuzmik alexkuzmik merged commit 45e509c into comet-ml:main Jan 29, 2025
10 of 40 checks passed
@alexkuzmik
Copy link
Collaborator

@17jmumford thanks, good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Regex Syntax Throwing Warning
2 participants