mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
chore(deps): Unpin sqlparse dependency (#21581)
Co-authored-by: Erik Cederstrand <erik@adamatics.com> Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
@@ -273,7 +273,7 @@ sqlalchemy-utils==0.38.3
|
|||||||
# via
|
# via
|
||||||
# apache-superset
|
# apache-superset
|
||||||
# flask-appbuilder
|
# flask-appbuilder
|
||||||
sqlparse==0.3.0
|
sqlparse==0.4.3
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
tabulate==0.8.9
|
tabulate==0.8.9
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -117,7 +117,7 @@ setup(
|
|||||||
"slackclient==2.5.0", # PINNED! slack changes file upload api in the future versions
|
"slackclient==2.5.0", # PINNED! slack changes file upload api in the future versions
|
||||||
"sqlalchemy>=1.4, <2",
|
"sqlalchemy>=1.4, <2",
|
||||||
"sqlalchemy-utils>=0.38.3, <0.39",
|
"sqlalchemy-utils>=0.38.3, <0.39",
|
||||||
"sqlparse==0.3.0", # PINNED! see https://github.com/andialbrecht/sqlparse/issues/562
|
"sqlparse>=0.4.3, <0.5",
|
||||||
"tabulate==0.8.9",
|
"tabulate==0.8.9",
|
||||||
# needed to support Literal (3.8) and TypeGuard (3.10)
|
# needed to support Literal (3.8) and TypeGuard (3.10)
|
||||||
"typing-extensions>=3.10, <4",
|
"typing-extensions>=3.10, <4",
|
||||||
|
|||||||
@@ -266,13 +266,9 @@ def test_extract_tables_illdefined() -> None:
|
|||||||
assert extract_tables("SELECT * FROM catalogname..tbname") == set()
|
assert extract_tables("SELECT * FROM catalogname..tbname") == set()
|
||||||
|
|
||||||
|
|
||||||
@unittest.skip("Requires sqlparse>=3.1")
|
|
||||||
def test_extract_tables_show_tables_from() -> None:
|
def test_extract_tables_show_tables_from() -> None:
|
||||||
"""
|
"""
|
||||||
Test ``SHOW TABLES FROM``.
|
Test ``SHOW TABLES FROM``.
|
||||||
|
|
||||||
This is currently broken in the pinned version of sqlparse, and fixed in
|
|
||||||
``sqlparse>=3.1``. However, ``sqlparse==3.1`` breaks some sql formatting.
|
|
||||||
"""
|
"""
|
||||||
assert extract_tables("SHOW TABLES FROM s1 like '%order%'") == set()
|
assert extract_tables("SHOW TABLES FROM s1 like '%order%'") == set()
|
||||||
|
|
||||||
@@ -1017,15 +1013,15 @@ def test_unknown_select() -> None:
|
|||||||
Test that `is_select` works when sqlparse fails to identify the type.
|
Test that `is_select` works when sqlparse fails to identify the type.
|
||||||
"""
|
"""
|
||||||
sql = "WITH foo AS(SELECT 1) SELECT 1"
|
sql = "WITH foo AS(SELECT 1) SELECT 1"
|
||||||
assert sqlparse.parse(sql)[0].get_type() == "UNKNOWN"
|
assert sqlparse.parse(sql)[0].get_type() == "SELECT"
|
||||||
assert ParsedQuery(sql).is_select()
|
assert ParsedQuery(sql).is_select()
|
||||||
|
|
||||||
sql = "WITH foo AS(SELECT 1) INSERT INTO my_table (a) VALUES (1)"
|
sql = "WITH foo AS(SELECT 1) INSERT INTO my_table (a) VALUES (1)"
|
||||||
assert sqlparse.parse(sql)[0].get_type() == "UNKNOWN"
|
assert sqlparse.parse(sql)[0].get_type() == "INSERT"
|
||||||
assert not ParsedQuery(sql).is_select()
|
assert not ParsedQuery(sql).is_select()
|
||||||
|
|
||||||
sql = "WITH foo AS(SELECT 1) DELETE FROM my_table"
|
sql = "WITH foo AS(SELECT 1) DELETE FROM my_table"
|
||||||
assert sqlparse.parse(sql)[0].get_type() == "UNKNOWN"
|
assert sqlparse.parse(sql)[0].get_type() == "DELETE"
|
||||||
assert not ParsedQuery(sql).is_select()
|
assert not ParsedQuery(sql).is_select()
|
||||||
|
|
||||||
|
|
||||||
@@ -1108,15 +1104,6 @@ SELECT * FROM birth_names LIMIT 1
|
|||||||
def test_sqlparse_formatting():
|
def test_sqlparse_formatting():
|
||||||
"""
|
"""
|
||||||
Test that ``from_unixtime`` is formatted correctly.
|
Test that ``from_unixtime`` is formatted correctly.
|
||||||
|
|
||||||
``sqlparse==0.3.1`` has a bug and removes space between ``from`` and
|
|
||||||
``from_unixtime``, resulting in::
|
|
||||||
|
|
||||||
SELECT extract(HOUR
|
|
||||||
fromfrom_unixtime(hour_ts)
|
|
||||||
AT TIME ZONE 'America/Los_Angeles')
|
|
||||||
from table
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
assert sqlparse.format(
|
assert sqlparse.format(
|
||||||
"SELECT extract(HOUR from from_unixtime(hour_ts) "
|
"SELECT extract(HOUR from from_unixtime(hour_ts) "
|
||||||
|
|||||||
Reference in New Issue
Block a user