Skip to content

Commit f3dd1ea

Browse files
committed
Fix backslash esacpe pattern match variants
1 parent 8ed1be1 commit f3dd1ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pg_es_fdw/_es_query.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ def _pg_es_pattern_map(matchobj):
3535
return "%"
3636
elif matchobj.group(0) == "\_":
3737
return "_"
38+
elif matchobj.group(0) == "\\\\":
39+
return "\\"
3840

39-
return re.sub(r'\\?%|\\?_', _pg_es_pattern_map, expr)
41+
return re.sub(r'\\\\|\\?%|\\?_', _pg_es_pattern_map, fr"{expr}")
4042

4143

4244
def _base_qual_to_es(col, op, value, column_map=None):

0 commit comments

Comments
 (0)