Skip to content

Commit a7eaa3f

Browse files
author
wangyuhang
committed
Pylint
1 parent bd1b5df commit a7eaa3f

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

sql_metadata/parser.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,6 @@ def query(self) -> str:
8585
"""
8686
return self._query.replace("\n", " ").replace(" ", " ")
8787

88-
@staticmethod
89-
def get_switch_by_create_query(tokens: List[SQLToken], index: int) -> str:
90-
switch = tokens[index].normalized + tokens[index + 1].normalized
91-
92-
# Hive CREATE FUNCTION
93-
if any(
94-
index + i < len(tokens) and tokens[index + i].normalized == "FUNCTION"
95-
for i in (1, 2)
96-
):
97-
switch = "CREATEFUNCTION"
98-
99-
return switch
100-
10188
@property
10289
def query_type(self) -> str:
10390
"""
@@ -1094,3 +1081,19 @@ def _flatten_sqlparse(self):
10941081
yield tok
10951082
else:
10961083
yield token
1084+
1085+
@staticmethod
1086+
def _get_switch_by_create_query(tokens: List[SQLToken], index: int) -> str:
1087+
"""
1088+
Return the switch that creates query type.
1089+
"""
1090+
switch = tokens[index].normalized + tokens[index + 1].normalized
1091+
1092+
# Hive CREATE FUNCTION
1093+
if any(
1094+
index + i < len(tokens) and tokens[index + i].normalized == "FUNCTION"
1095+
for i in (1, 2)
1096+
):
1097+
switch = "CREATEFUNCTION"
1098+
1099+
return switch

0 commit comments

Comments
 (0)