Skip to content

Commit 9fcb16d

Browse files
fix splitting
1 parent 14c171f commit 9fcb16d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/computation/parsing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ def _split_by_backtick(s: str) -> list[tuple[bool, str]]:
231231
if next_quote_index == -1:
232232
substrings.append((False, substring + s[i:]))
233233
break
234-
# Quote is matched
234+
# Quote is matched, and the next quote is at the end of the string
235+
elif next_quote_index + 1 == len(s):
236+
substrings.append((False, substring + s[i:]))
237+
break
238+
# Quote is matched, and the next quote is in the middle of the string
235239
else:
236240
substring += s[i : next_quote_index + 1]
237241
i = next_quote_index + 1

0 commit comments

Comments
 (0)