@@ -123,16 +123,6 @@ def clean_column_name(name: Hashable) -> Hashable:
123
123
-------
124
124
name : hashable
125
125
Returns the name after tokenizing and cleaning.
126
-
127
- Notes
128
- -----
129
- For some cases, a name cannot be converted to a valid Python identifier.
130
- In that case :func:`tokenize_string` raises a SyntaxError.
131
- In that case, we just return the name unmodified.
132
-
133
- If this name was used in the query string (this makes the query call impossible)
134
- an error will be raised by :func:`tokenize_backtick_quoted_string` instead,
135
- which is not caught and propagates to the user level.
136
126
"""
137
127
try :
138
128
# Escape backticks
@@ -145,40 +135,6 @@ def clean_column_name(name: Hashable) -> Hashable:
145
135
return name
146
136
147
137
148
- def tokenize_backtick_quoted_string (
149
- token_generator : Iterator [tokenize .TokenInfo ], source : str , string_start : int
150
- ) -> tuple [int , str ]:
151
- """
152
- Creates a token from a backtick quoted string.
153
-
154
- Moves the token_generator forwards till right after the next backtick.
155
-
156
- Parameters
157
- ----------
158
- token_generator : Iterator[tokenize.TokenInfo]
159
- The generator that yields the tokens of the source string (Tuple[int, str]).
160
- The generator is at the first token after the backtick (`)
161
-
162
- source : str
163
- The Python source code string.
164
-
165
- string_start : int
166
- This is the start of backtick quoted string inside the source string.
167
-
168
- Returns
169
- -------
170
- tok: Tuple[int, str]
171
- The token that represents the backtick quoted string.
172
- The integer is equal to BACKTICK_QUOTED_STRING (100).
173
- """
174
- for _ , tokval , start , _ , _ in token_generator :
175
- if tokval == "`" :
176
- string_end = start [1 ]
177
- break
178
-
179
- return BACKTICK_QUOTED_STRING , source [string_start :string_end ]
180
-
181
-
182
138
class ParseState (Enum ):
183
139
DEFAULT = 0
184
140
IN_BACKTICK = 1
0 commit comments