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:
parent
73429c6b2a
commit
82bd5a31b8
|
|
@ -273,7 +273,7 @@ sqlalchemy-utils==0.38.3
|
|||
# via
|
||||
# apache-superset
|
||||
# flask-appbuilder
|
||||
sqlparse==0.3.0
|
||||
sqlparse==0.4.3
|
||||
# via apache-superset
|
||||
tabulate==0.8.9
|
||||
# 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
|
||||
"sqlalchemy>=1.4, <2",
|
||||
"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",
|
||||
# needed to support Literal (3.8) and TypeGuard (3.10)
|
||||
"typing-extensions>=3.10, <4",
|
||||
|
|
|
|||
|
|
@ -266,13 +266,9 @@ def test_extract_tables_illdefined() -> None:
|
|||
assert extract_tables("SELECT * FROM catalogname..tbname") == set()
|
||||
|
||||
|
||||
@unittest.skip("Requires sqlparse>=3.1")
|
||||
def test_extract_tables_show_tables_from() -> None:
|
||||
"""
|
||||
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()
|
||||
|
||||
|
|
@ -1017,15 +1013,15 @@ def test_unknown_select() -> None:
|
|||
Test that `is_select` works when sqlparse fails to identify the type.
|
||||
"""
|
||||
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()
|
||||
|
||||
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()
|
||||
|
||||
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()
|
||||
|
||||
|
||||
|
|
@ -1108,15 +1104,6 @@ SELECT * FROM birth_names LIMIT 1
|
|||
def test_sqlparse_formatting():
|
||||
"""
|
||||
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(
|
||||
"SELECT extract(HOUR from from_unixtime(hour_ts) "
|
||||
|
|
|
|||
Loading…
Reference in New Issue