Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 99ec449

Browse files
partheaYasser Elsayed
authored andcommitted
Resolve issue where the legacy bq.Query command would raise TypeError (#321)
1 parent bfff3bc commit 99ec449

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

datalab/data/_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def end_identifier(s, i):
102102
def start_string(s, i):
103103
return s[i] == '"' or s[i] == "'"
104104

105+
def always_true(s, i):
106+
return True
107+
105108
while i < len(sql):
106109
start = i
107110
if start_multi_line_comment(sql, i):
@@ -119,13 +122,13 @@ def start_string(s, i):
119122
elif start_string(sql, i):
120123
# Special handling here as we need to check for escaped closing quotes.
121124
quote = sql[i]
122-
end_checker = True
125+
end_checker = always_true
123126
i += 1
124127
while i < len(sql) and sql[i] != quote:
125128
i += 2 if sql[i] == '\\' else 1
126129
else:
127130
# We return single characters for everything else
128-
end_checker = True
131+
end_checker = always_true
129132

130133
i += 1
131134
while i < len(sql) and not end_checker(sql, i):

0 commit comments

Comments
 (0)