Skip to content

[Fix] Resolve regex warnings#94

Open
colinthebomb1 wants to merge 1 commit intomainfrom
fix/fix-regex-warnings
Open

[Fix] Resolve regex warnings#94
colinthebomb1 wants to merge 1 commit intomainfrom
fix/fix-regex-warnings

Conversation

@colinthebomb1
Copy link
Collaborator

Overview:

This PR fixes a warning in regex expressions by using raw strings for regex expressions. The PR also fixes a warning for unused return statements in ast test cases.

Example warnings:

core/rule_parser.py:238
/home/runner/work/QueryBooster/QueryBooster/core/rule_parser.py:238: DeprecationWarning: invalid escape sequence '\(' 'markerStart': ['\(', '\{', '\['],

tests/test_ast.py::test_complete_query
  /opt/hostedtoolcache/Python/3.10.19/x64/lib/python3.10/site-packages/_pytest/python.py:170: PytestReturnNotNoneWarning: Test functions should return None, but tests/test_ast.py::test_complete_query returned <class 'core.ast.node.QueryNode'>.

Code Changes:

  • Used raw strings for regex in rule_parser.py and rule_generator.py
  • Removed unused returns in test_ast.py

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.

1 participant