Skip to content

Commit

Permalink
Pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
MiuNice authored and wangyuhang committed Jun 14, 2024
1 parent bd1b5df commit 12c3628
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions sql_metadata/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ def query(self) -> str:
"""
return self._query.replace("\n", " ").replace(" ", " ")

@staticmethod
def get_switch_by_create_query(tokens: List[SQLToken], index: int) -> str:
switch = tokens[index].normalized + tokens[index + 1].normalized

# Hive CREATE FUNCTION
if any(
index + i < len(tokens) and tokens[index + i].normalized == "FUNCTION"
for i in (1, 2)
):
switch = "CREATEFUNCTION"

return switch

@property
def query_type(self) -> str:
"""
Expand Down Expand Up @@ -1094,3 +1081,19 @@ def _flatten_sqlparse(self):
yield tok
else:
yield token

@staticmethod
def _get_switch_by_create_query(tokens: List[SQLToken], index: int) -> str:
"""
Return the switch that creates query type.
"""
switch = tokens[index].normalized + tokens[index + 1].normalized

# Hive CREATE FUNCTION
if any(
index + i < len(tokens) and tokens[index + i].normalized == "FUNCTION"
for i in (1, 2)
):
switch = "CREATEFUNCTION"

return switch

0 comments on commit 12c3628

Please sign in to comment.