From 70edaa0b4661df6f251f2e3d3ae5c55ef371fc74 Mon Sep 17 00:00:00 2001 From: Trinh Quoc Anh Date: Wed, 5 Feb 2025 22:46:22 +0100 Subject: [PATCH] Remove unused code (#60860) --- pandas/core/computation/parsing.py | 44 ------------------------------ 1 file changed, 44 deletions(-) diff --git a/pandas/core/computation/parsing.py b/pandas/core/computation/parsing.py index 35a6d1c6ad269..8441941797a6e 100644 --- a/pandas/core/computation/parsing.py +++ b/pandas/core/computation/parsing.py @@ -123,16 +123,6 @@ def clean_column_name(name: Hashable) -> Hashable: ------- name : hashable Returns the name after tokenizing and cleaning. - - Notes - ----- - For some cases, a name cannot be converted to a valid Python identifier. - In that case :func:`tokenize_string` raises a SyntaxError. - In that case, we just return the name unmodified. - - If this name was used in the query string (this makes the query call impossible) - an error will be raised by :func:`tokenize_backtick_quoted_string` instead, - which is not caught and propagates to the user level. """ try: # Escape backticks @@ -145,40 +135,6 @@ def clean_column_name(name: Hashable) -> Hashable: return name -def tokenize_backtick_quoted_string( - token_generator: Iterator[tokenize.TokenInfo], source: str, string_start: int -) -> tuple[int, str]: - """ - Creates a token from a backtick quoted string. - - Moves the token_generator forwards till right after the next backtick. - - Parameters - ---------- - token_generator : Iterator[tokenize.TokenInfo] - The generator that yields the tokens of the source string (Tuple[int, str]). - The generator is at the first token after the backtick (`) - - source : str - The Python source code string. - - string_start : int - This is the start of backtick quoted string inside the source string. - - Returns - ------- - tok: Tuple[int, str] - The token that represents the backtick quoted string. - The integer is equal to BACKTICK_QUOTED_STRING (100). - """ - for _, tokval, start, _, _ in token_generator: - if tokval == "`": - string_end = start[1] - break - - return BACKTICK_QUOTED_STRING, source[string_start:string_end] - - class ParseState(Enum): DEFAULT = 0 IN_BACKTICK = 1