Skip to content

Commit f022940

Browse files
authored
Remove sqlparse.compat import (#38)
sqlparse do no longer have sqlparse.compat. It was removed in version 0.4. It is missing from GitHub source and sqlparse-0.4.2.tar.gz from PyPI. But it exist in sqlparse-0.4.2-py3-none-any.whl from PyPi for some strang reasone. Since databricks-sql-cli import 'text_type' form sqlparse.compat it will fail if you install sqlparse in any other way other than wheel. sqlparse was remooved in the following commit: andialbrecht/sqlparse@3e3892f 'text_type' was replaced with 'str' so we do the same in databricks-sql-cli.
1 parent 345ca09 commit f022940

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dbsqlcli/packages/completion_engine.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import logging
55
from collections import namedtuple
66
from sqlparse.sql import Comparison, Identifier, Where
7-
from sqlparse.compat import text_type
87

98
from dbsqlcli.packages.parseutils import last_word, extract_tables, find_prev_keyword
109
from dbsqlcli.packages.special import parse_special_command
@@ -78,7 +77,7 @@ def suggest_type(full_text, text_before_cursor):
7877
stmt_start, stmt_end = 0, 0
7978

8079
for statement in parsed:
81-
stmt_len = len(text_type(statement))
80+
stmt_len = len(str(statement))
8281
stmt_start, stmt_end = stmt_end, stmt_end + stmt_len
8382

8483
if stmt_end >= current_pos:

0 commit comments

Comments
 (0)