mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
test/cql-pytest: use raw string when appropriate
we use "\w" to represent a character class in Python. see https://docs.python.org/3/library/re.html. but "\" should be escaped as well, CPython accepts "\w" after trying to find an escaped character of "\." but failed, and leave "\." as it is. but it complains. in this change, we use raw string to avoid escaping "\" in the regular expression. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#16405
This commit is contained in:
@@ -122,7 +122,7 @@ def disablebinary(cql):
|
||||
run_nodetool(cql, "disablebinary")
|
||||
|
||||
def parse_keyspace_table(name, separator_chars = '.'):
|
||||
pat = f"(?P<keyspace>\w+)(?:[{separator_chars}](?P<table>\w+))?"
|
||||
pat = rf"(?P<keyspace>\w+)(?:[{separator_chars}](?P<table>\w+))?"
|
||||
m = re.match(pat, name)
|
||||
return m.group('keyspace'), m.group('table')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user