diff --git a/UPDATING.md b/UPDATING.md index e1b14db28f184..2915976bcd66a 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -26,6 +26,7 @@ assists people when migrating to a new version. - [19046](https://github.com/apache/superset/pull/19046): Enables the drag and drop interface in Explore control panel by default. Flips `ENABLE_EXPLORE_DRAG_AND_DROP` and `ENABLE_DND_WITH_CLICK_UX` feature flags to `True`. - [18936](https://github.com/apache/superset/pull/18936): Removes legacy SIP-15 interm logic/flags—specifically the `SIP_15_ENABLED`, `SIP_15_GRACE_PERIOD_END`, `SIP_15_DEFAULT_TIME_RANGE_ENDPOINTS`, and `SIP_15_TOAST_MESSAGE` flags. Time range endpoints are no longer configurable and strictly adhere to the `[start, end)` paradigm, i.e., inclusive of the start and exclusive of the end. Additionally this change removes the now obsolete `time_range_endpoints` from the form-data and resulting in the cache being busted. +- [19570](https://github.com/apache/superset/pull/19570): makes [sqloxide](https://pypi.org/project/sqloxide/) optional so the SIP-68 migration can be run on aarch64. If the migration is taking too long installing sqloxide manually should improve the performance. ### Breaking Changes diff --git a/requirements/testing.in b/requirements/testing.in index c33f245280bb0..082dbc934ac5c 100644 --- a/requirements/testing.in +++ b/requirements/testing.in @@ -36,6 +36,7 @@ pytest pytest-cov statsd pytest-mock +sqloxide # DB dependencies -e file:.[bigquery] -e file:.[trino] diff --git a/requirements/testing.txt b/requirements/testing.txt index 3b1ce021873f5..dbdb9e5077e87 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -1,4 +1,4 @@ -# SHA1:7a8e256097b4758bdeda2529d3d4d31e421e1a3c +# SHA1:e273e8da6bfd5f6f8563fe067e243297cc7c588c # # This file is autogenerated by pip-compile-multi # To update, run: @@ -52,7 +52,6 @@ google-auth-oauthlib==0.4.6 google-cloud-bigquery[bqstorage,pandas]==2.29.0 # via # -r requirements/testing.in - # apache-superset # pandas-gbq # pybigquery google-cloud-bigquery-storage==2.9.1 @@ -105,9 +104,7 @@ openapi-schema-validator==0.1.5 openapi-spec-validator==0.3.1 # via -r requirements/testing.in pandas-gbq==0.15.0 - # via - # -r requirements/testing.in - # apache-superset + # via -r requirements/testing.in parameterized==0.8.1 # via -r requirements/testing.in parso==0.8.2 @@ -136,9 +133,7 @@ pyasn1==0.4.8 pyasn1-modules==0.2.8 # via google-auth pybigquery==0.10.2 - # via - # -r requirements/testing.in - # apache-superset + # via -r requirements/testing.in pydata-google-auth==1.2.0 # via pandas-gbq pyfakefs==4.5.0 @@ -166,6 +161,8 @@ rsa==4.7.2 # via google-auth sqlalchemy-trino==0.4.1 # via apache-superset +sqloxide==0.1.15 + # via -r requirements/testing.in statsd==3.3.0 # via -r requirements/testing.in traitlets==5.0.5 diff --git a/setup.py b/setup.py index c7cdd2acd2185..766e738b3b92d 100644 --- a/setup.py +++ b/setup.py @@ -111,7 +111,6 @@ def get_git_sha() -> str: "slackclient==2.5.0", # PINNED! slack changes file upload api in the future versions "sqlalchemy>=1.3.16, <1.4, !=1.3.21", "sqlalchemy-utils>=0.37.8, <0.38", - "sqloxide==0.1.15", "sqlparse==0.3.0", # PINNED! see https://github.com/andialbrecht/sqlparse/issues/562 "tabulate==0.8.9", # needed to support Literal (3.8) and TypeGuard (3.10) diff --git a/superset/migrations/shared/utils.py b/superset/migrations/shared/utils.py index bff25e05d137f..c54de83c42af0 100644 --- a/superset/migrations/shared/utils.py +++ b/superset/migrations/shared/utils.py @@ -21,7 +21,11 @@ from sqlalchemy import engine_from_config from sqlalchemy.engine import reflection from sqlalchemy.exc import NoSuchTableError -from sqloxide import parse_sql + +try: + from sqloxide import parse_sql +except ImportError: + parse_sql = None from superset.sql_parse import ParsedQuery, Table @@ -88,6 +92,10 @@ def extract_table_references(sql_text: str, sqla_dialect: str) -> Set[Table]: """ Return all the dependencies from a SQL sql_text. """ + if not parse_sql: + parsed = ParsedQuery(sql_text) + return parsed.tables + dialect = "generic" for dialect, sqla_dialects in sqloxide_dialects.items(): if sqla_dialect in sqla_dialects: