diff --git a/.github/workflows/superset-python-presto-hive.yml b/.github/workflows/superset-python-presto-hive.yml index 934954984844..2ca9b8a8dbc8 100644 --- a/.github/workflows/superset-python-presto-hive.yml +++ b/.github/workflows/superset-python-presto-hive.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config @@ -91,7 +91,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] env: PYTHONPATH: ${{ github.workspace }} SUPERSET_CONFIG: tests.integration_tests.superset_test_config diff --git a/requirements/base.txt b/requirements/base.txt index 93721bf232ea..ca118d9ce123 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -122,6 +122,8 @@ geographiclib==1.52 # via geopy geopy==2.2.0 # via apache-superset +greenlet==2.0.2 + # via sqlalchemy gunicorn==20.1.0 # via apache-superset hashids==1.3.1 @@ -310,7 +312,7 @@ werkzeug==2.3.3 # flask # flask-jwt-extended # flask-login -wrapt==1.12.1 +wrapt==1.15.0 # via deprecated wtforms==2.3.3 # via diff --git a/requirements/development.in b/requirements/development.in index efe5bb5747e6..0dbb515b2f09 100644 --- a/requirements/development.in +++ b/requirements/development.in @@ -21,6 +21,6 @@ ipython progress>=1.5,<2 pyinstrument>=4.0.2,<5 -pylint==2.9.6 +pylint==2.15.0 setuptools>=65.5.1 sqloxide diff --git a/requirements/development.txt b/requirements/development.txt index e398368e7a7c..0f4b65a0e0bb 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,137 +1,139 @@ -# SHA1:6d10e2cb134133e823edef48aa3e33b2b1b85681 -# -# This file is autogenerated by pip-compile-multi -# To update, run: -# -# pip-compile-multi -# --r base.txt --e file:. - # via - # -r requirements/base.in - # -r requirements/development.in -appnope==0.1.3 - # via ipython -astroid==2.6.6 - # via pylint -asttokens==2.2.1 - # via stack-data -backcall==0.2.0 - # via ipython -boto3==1.26.130 - # via tabulator -botocore==1.29.130 - # via - # boto3 - # s3transfer -cached-property==1.5.2 - # via tableschema -certifi==2023.5.7 - # via requests -chardet==5.1.0 - # via tabulator -charset-normalizer==3.1.0 - # via requests -decorator==5.1.1 - # via ipython -et-xmlfile==1.1.0 - # via openpyxl -executing==1.2.0 - # via stack-data -flask-cors==3.0.10 - # via apache-superset -future==0.18.3 - # via pyhive -ijson==3.2.0.post0 - # via tabulator -ipython==8.12.2 - # via -r requirements/development.in -isort==5.12.0 - # via pylint -jedi==0.18.2 - # via ipython -jmespath==1.0.1 - # via - # boto3 - # botocore -jsonlines==3.1.0 - # via tabulator -lazy-object-proxy==1.9.0 - # via astroid -linear-tsv==1.1.0 - # via tabulator -matplotlib-inline==0.1.6 - # via ipython -mccabe==0.6.1 - # via pylint -mysqlclient==2.1.0 - # via apache-superset -openpyxl==3.1.2 - # via tabulator -parso==0.8.3 - # via jedi -pexpect==4.8.0 - # via ipython -pickleshare==0.7.5 - # via ipython -pillow==9.5.0 - # via apache-superset -progress==1.6 - # via -r requirements/development.in -psycopg2-binary==2.9.6 - # via apache-superset -ptyprocess==0.7.0 - # via pexpect -pure-eval==0.2.2 - # via stack-data -pure-sasl==0.6.2 - # via thrift-sasl -pydruid==0.6.5 - # via apache-superset -pyhive[hive]==0.6.5 - # via apache-superset -pyinstrument==4.4.0 - # via -r requirements/development.in -pylint==2.9.6 - # via -r requirements/development.in -requests==2.30.0 - # via - # pydruid - # tableschema - # tabulator -rfc3986==2.0.0 - # via tableschema -s3transfer==0.6.1 - # via boto3 -sasl==0.3.1 - # via pyhive -sqloxide==0.1.33 - # via -r requirements/development.in -stack-data==0.6.2 - # via ipython -tableschema==1.20.2 - # via apache-superset -tabulator==1.53.5 - # via tableschema -thrift==0.16.0 - # via - # apache-superset - # pyhive - # thrift-sasl -thrift-sasl==0.4.3 - # via pyhive -toml==0.10.2 - # via pylint -traitlets==5.9.0 - # via - # ipython - # matplotlib-inline -unicodecsv==0.14.1 - # via - # tableschema - # tabulator -xlrd==2.0.1 - # via tabulator - -# The following packages are considered to be unsafe in a requirements file: -# setuptools +# SHA1:4c968a12954870dc2461956c6fccb6a1065404fd +# +# This file is autogenerated by pip-compile-multi +# To update, run: +# +# pip-compile-multi +# +-r base.txt +-e file:. + # via + # -r requirements/base.in + # -r requirements/development.in +astroid==2.13.5 + # via pylint +asttokens==2.2.1 + # via stack-data +backcall==0.2.0 + # via ipython +boto3==1.26.130 + # via tabulator +botocore==1.29.130 + # via + # boto3 + # s3transfer +cached-property==1.5.2 + # via tableschema +certifi==2023.5.7 + # via requests +chardet==5.1.0 + # via tabulator +charset-normalizer==3.1.0 + # via requests +decorator==5.1.1 + # via ipython +dill==0.3.6 + # via pylint +et-xmlfile==1.1.0 + # via openpyxl +executing==1.2.0 + # via stack-data +flask-cors==3.0.10 + # via apache-superset +future==0.18.3 + # via pyhive +ijson==3.2.0.post0 + # via tabulator +ipython==8.12.2 + # via -r requirements/development.in +isort==5.12.0 + # via pylint +jedi==0.18.2 + # via ipython +jmespath==1.0.1 + # via + # boto3 + # botocore +jsonlines==3.1.0 + # via tabulator +lazy-object-proxy==1.9.0 + # via astroid +linear-tsv==1.1.0 + # via tabulator +matplotlib-inline==0.1.6 + # via ipython +mccabe==0.6.1 + # via pylint +mysqlclient==2.1.0 + # via apache-superset +openpyxl==3.1.2 + # via tabulator +parso==0.8.3 + # via jedi +pexpect==4.8.0 + # via ipython +pickleshare==0.7.5 + # via ipython +pillow==9.5.0 + # via apache-superset +platformdirs==3.5.1 + # via pylint +progress==1.6 + # via -r requirements/development.in +psycopg2-binary==2.9.6 + # via apache-superset +ptyprocess==0.7.0 + # via pexpect +pure-eval==0.2.2 + # via stack-data +pure-sasl==0.6.2 + # via + # pyhive + # thrift-sasl +pydruid==0.6.5 + # via apache-superset +pyhive @ git+https://github.com/dropbox/PyHive.git@b3c123195b6d2586e1e609eefecafe036324eb46 + # via apache-superset +pyinstrument==4.4.0 + # via -r requirements/development.in +pylint==2.15.0 + # via -r requirements/development.in +requests==2.30.0 + # via + # pydruid + # tableschema + # tabulator +rfc3986==2.0.0 + # via tableschema +s3transfer==0.6.1 + # via boto3 +sqloxide==0.1.33 + # via -r requirements/development.in +stack-data==0.6.2 + # via ipython +tableschema==1.20.2 + # via apache-superset +tabulator==1.53.5 + # via tableschema +thrift==0.16.0 + # via + # apache-superset + # pyhive + # thrift-sasl +thrift-sasl==0.4.3 + # via pyhive +tomlkit==0.11.8 + # via pylint +traitlets==5.9.0 + # via + # ipython + # matplotlib-inline +unicodecsv==0.14.1 + # via + # tableschema + # tabulator +xlrd==2.0.1 + # via tabulator + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/integration.txt b/requirements/integration.txt index b9fdb03e0c22..8732a650fa5c 100644 --- a/requirements/integration.txt +++ b/requirements/integration.txt @@ -38,7 +38,7 @@ pip-compile-multi==2.6.3 # via -r requirements/integration.in pip-tools==6.13.0 # via pip-compile-multi -platformdirs==3.5.0 +platformdirs==3.5.1 # via # tox # virtualenv @@ -52,11 +52,6 @@ pyproject-hooks==1.0.0 # via build pyyaml==5.4.1 # via pre-commit -tomli==2.0.1 - # via - # build - # pyproject-api - # tox toposort==1.10 # via pip-compile-multi tox==4.5.1 diff --git a/requirements/testing.txt b/requirements/testing.txt index efa48fcad939..c4de6670ee37 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -18,8 +18,6 @@ db-dtypes==1.1.1 # via pandas-gbq docker==6.1.1 # via -r requirements/testing.in -exceptiongroup==1.1.1 - # via pytest flask-testing==0.8.1 # via -r requirements/testing.in freezegun==1.2.2 @@ -107,8 +105,6 @@ pydata-google-auth==1.7.0 # via pandas-gbq pyfakefs==5.2.2 # via -r requirements/testing.in -pyhive[presto]==0.6.5 - # via apache-superset pytest==7.3.1 # via # -r requirements/testing.in diff --git a/setup.py b/setup.py index d59f0c6496a0..0fee417ff635 100644 --- a/setup.py +++ b/setup.py @@ -1,203 +1,203 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -import io -import json -import os -import subprocess -import sys - -from setuptools import find_packages, setup - -BASE_DIR = os.path.abspath(os.path.dirname(__file__)) -PACKAGE_JSON = os.path.join(BASE_DIR, "superset-frontend", "package.json") - -with open(PACKAGE_JSON, "r") as package_file: - version_string = json.load(package_file)["version"] - -with io.open("README.md", "r", encoding="utf-8") as f: - long_description = f.read() - - -def get_git_sha() -> str: - try: - s = subprocess.check_output(["git", "rev-parse", "HEAD"]) - return s.decode().strip() - except Exception: - return "" - - -GIT_SHA = get_git_sha() -version_info = {"GIT_SHA": GIT_SHA, "version": version_string} -print("-==-" * 15) -print("VERSION: " + version_string) -print("GIT SHA: " + GIT_SHA) -print("-==-" * 15) - -VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset", "static", "version_info.json") - -with open(VERSION_INFO_FILE, "w") as version_file: - json.dump(version_info, version_file) - - -setup( - name="apache-superset", - description="A modern, enterprise-ready business intelligence web application", - long_description=long_description, - long_description_content_type="text/markdown", - version=version_string, - packages=find_packages(), - include_package_data=True, - zip_safe=False, - entry_points={ - "console_scripts": ["superset=superset.cli.main:superset"], - # the `postgres` and `postgres+psycopg2://` schemes were removed in SQLAlchemy 1.4 - # add an alias here to prevent breaking existing databases - "sqlalchemy.dialects": [ - "postgres.psycopg2 = sqlalchemy.dialects.postgresql:dialect", - "postgres = sqlalchemy.dialects.postgresql:dialect", - ], - }, - install_requires=[ - "backoff>=1.8.0", - "cachelib>=0.4.1,<0.5", - "celery>=5.2.2, <6.0.0", - "click>=8.0.3", - "click-option-group", - "colorama", - "croniter>=0.3.28", - "cron-descriptor", - "cryptography>=39.0.1, <40", - "deprecation>=2.1.0, <2.2.0", - "flask>=2.2.5, <3.0.0", - "flask-appbuilder>=4.3.0, <5.0.0", - "flask-caching>=1.10.1, <1.11", - "flask-compress>=1.13, <2.0", - "flask-talisman>=1.0.0, <2.0", - "flask-login==0.6.0", - "flask-migrate>=3.1.0, <4.0", - "flask-wtf>=1.0.1, <1.1", - "func_timeout", - "geopy", - "gunicorn>=20.1.0; sys_platform != 'win32'", - "hashids>=1.3.1, <2", - "holidays>=0.23, <0.24", - "humanize", - "isodate", - "Mako>=1.2.2", - "markdown>=3.0", - "msgpack>=1.0.0, <1.1", - "nh3>=0.2.11, <0.3", - "numpy==1.23.5", - "packaging", - "pandas>=1.5.3, <1.6", - "parsedatetime", - "pgsanity", - "polyline>=2.0.0, <3.0", - "pyparsing>=3.0.6, <4", - "python-dateutil", - "python-dotenv", - "python-geohash", - "pyarrow>=10.0.1, <11", - "pyyaml>=5.4", - "PyJWT>=2.4.0, <3.0", - "redis>=4.5.4, <5.0", - "selenium>=3.141.0", - "shortid", - "sshtunnel>=0.4.0, <0.5", - "simplejson>=3.15.0", - "slack_sdk>=3.19.0, <4", - "sqlalchemy>=1.4, <2", - "sqlalchemy-utils>=0.38.3, <0.39", - "sqlparse>=0.4.3, <0.5", - "tabulate>=0.8.9, <0.9", - "typing-extensions>=4, <5", - "waitress; sys_platform == 'win32'", - "werkzeug>=2.3.3, <3", - "wtforms>=2.3.3, <4", - "wtforms-json", - "xlsxwriter>=3.0.7, <3.1", - ], - extras_require={ - "athena": ["pyathena[pandas]>=2, <3"], - "aurora-data-api": ["preset-sqlalchemy-aurora-data-api>=0.2.8,<0.3"], - "bigquery": [ - "pandas-gbq>=0.19.1", - "sqlalchemy-bigquery>=1.6.1", - "google-cloud-bigquery>=3.10.0", - ], - "clickhouse": ["clickhouse-connect>=0.5.14, <1.0"], - "cockroachdb": ["cockroachdb>=0.3.5, <0.4"], - "cors": ["flask-cors>=2.0.0"], - "crate": ["crate[sqlalchemy]>=0.26.0, <0.27"], - "databricks": [ - "databricks-sql-connector>=2.0.2, <3", - "sqlalchemy-databricks>=0.2.0", - ], - "db2": ["ibm-db-sa>=0.3.5, <0.4"], - "dremio": ["sqlalchemy-dremio>=1.1.5, <1.3"], - "drill": ["sqlalchemy-drill==0.1.dev"], - "druid": ["pydruid>=0.6.5,<0.7"], - "dynamodb": ["pydynamodb>=0.4.2"], - "solr": ["sqlalchemy-solr >= 0.2.0"], - "elasticsearch": ["elasticsearch-dbapi>=0.2.9, <0.3.0"], - "exasol": ["sqlalchemy-exasol >= 2.4.0, <3.0"], - "excel": ["xlrd>=1.2.0, <1.3"], - "firebird": ["sqlalchemy-firebird>=0.7.0, <0.8"], - "firebolt": ["firebolt-sqlalchemy>=0.0.1"], - "gsheets": ["shillelagh[gsheetsapi]>=1.0.14, <2"], - "hana": ["hdbcli==2.4.162", "sqlalchemy_hana==0.4.0"], - "hive": ["pyhive[hive]>=0.6.5", "tableschema", "thrift>=0.14.1, <1.0.0"], - "impala": ["impyla>0.16.2, <0.17"], - "kusto": ["sqlalchemy-kusto>=2.0.0, <3"], - "kylin": ["kylinpy>=2.8.1, <2.9"], - "mssql": ["pymssql>=2.1.4, <2.2"], - "mysql": ["mysqlclient>=2.1.0, <3"], - "ocient": [ - "sqlalchemy-ocient>=1.0.0", - "pyocient>=1.0.15", - "shapely", - "geojson", - ], - "oracle": ["cx-Oracle>8.0.0, <8.1"], - "pinot": ["pinotdb>=0.3.3, <0.4"], - "postgres": ["psycopg2-binary==2.9.6"], - "presto": ["pyhive[presto]>=0.6.5"], - "trino": ["trino>=0.324.0"], - "prophet": ["prophet>=1.0.1, <1.1", "pystan<3.0"], - "redshift": ["sqlalchemy-redshift>=0.8.1, < 0.9"], - "rockset": ["rockset>=0.8.10, <0.9"], - "shillelagh": [ - "shillelagh[datasetteapi,gsheetsapi,socrata,weatherapi]>=1.1.1, <2" - ], - "snowflake": ["snowflake-sqlalchemy>=1.2.4, <2"], - "spark": ["pyhive[hive]>=0.6.5", "tableschema", "thrift>=0.14.1, <1.0.0"], - "teradata": ["teradatasql>=16.20.0.23"], - "thumbnails": ["Pillow>=9.5.0, <10.0.0"], - "vertica": ["sqlalchemy-vertica-python>=0.5.9, < 0.6"], - "netezza": ["nzalchemy>=11.0.2"], - }, - python_requires="~=3.9", - author="Apache Software Foundation", - author_email="dev@superset.apache.org", - url="https://superset.apache.org/", - download_url="https://www.apache.org/dist/superset/" + version_string, - classifiers=[ - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], -) +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import io +import json +import os +import subprocess +import sys + +from setuptools import find_packages, setup + +BASE_DIR = os.path.abspath(os.path.dirname(__file__)) +PACKAGE_JSON = os.path.join(BASE_DIR, "superset-frontend", "package.json") + +with open(PACKAGE_JSON, "r") as package_file: + version_string = json.load(package_file)["version"] + +with io.open("README.md", "r", encoding="utf-8") as f: + long_description = f.read() + + +def get_git_sha() -> str: + try: + s = subprocess.check_output(["git", "rev-parse", "HEAD"]) + return s.decode().strip() + except Exception: + return "" + + +GIT_SHA = get_git_sha() +version_info = {"GIT_SHA": GIT_SHA, "version": version_string} +print("-==-" * 15) +print("VERSION: " + version_string) +print("GIT SHA: " + GIT_SHA) +print("-==-" * 15) + +VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset", "static", "version_info.json") + +with open(VERSION_INFO_FILE, "w") as version_file: + json.dump(version_info, version_file) + + +setup( + name="apache-superset", + description="A modern, enterprise-ready business intelligence web application", + long_description=long_description, + long_description_content_type="text/markdown", + version=version_string, + packages=find_packages(), + include_package_data=True, + zip_safe=False, + entry_points={ + "console_scripts": ["superset=superset.cli.main:superset"], + # the `postgres` and `postgres+psycopg2://` schemes were removed in SQLAlchemy 1.4 + # add an alias here to prevent breaking existing databases + "sqlalchemy.dialects": [ + "postgres.psycopg2 = sqlalchemy.dialects.postgresql:dialect", + "postgres = sqlalchemy.dialects.postgresql:dialect", + ], + }, + install_requires=[ + "backoff>=1.8.0", + "cachelib>=0.4.1,<0.5", + "celery>=5.2.2, <6.0.0", + "click>=8.0.3", + "click-option-group", + "colorama", + "croniter>=0.3.28", + "cron-descriptor", + "cryptography>=39.0.1, <40", + "deprecation>=2.1.0, <2.2.0", + "flask>=2.2.5, <3.0.0", + "flask-appbuilder>=4.3.0, <5.0.0", + "flask-caching>=1.10.1, <1.11", + "flask-compress>=1.13, <2.0", + "flask-talisman>=1.0.0, <2.0", + "flask-login==0.6.0", + "flask-migrate>=3.1.0, <4.0", + "flask-wtf>=1.0.1, <1.1", + "func_timeout", + "geopy", + "gunicorn>=20.1.0; sys_platform != 'win32'", + "hashids>=1.3.1, <2", + "holidays>=0.23, <0.24", + "humanize", + "isodate", + "Mako>=1.2.2", + "markdown>=3.0", + "msgpack>=1.0.0, <1.1", + "nh3>=0.2.11, <0.3", + "numpy==1.23.5", + "packaging", + "pandas>=1.5.3, <1.6", + "parsedatetime", + "pgsanity", + "polyline>=2.0.0, <3.0", + "pyparsing>=3.0.6, <4", + "python-dateutil", + "python-dotenv", + "python-geohash", + "pyarrow>=10.0.1, <11", + "pyyaml>=5.4", + "PyJWT>=2.4.0, <3.0", + "redis>=4.5.4, <5.0", + "selenium>=3.141.0", + "shortid", + "sshtunnel>=0.4.0, <0.5", + "simplejson>=3.15.0", + "slack_sdk>=3.19.0, <4", + "sqlalchemy>=1.4, <2", + "sqlalchemy-utils>=0.38.3, <0.39", + "sqlparse>=0.4.3, <0.5", + "tabulate>=0.8.9, <0.9", + "typing-extensions>=4, <5", + "waitress; sys_platform == 'win32'", + "werkzeug>=2.3.3, <3", + "wtforms>=2.3.3, <4", + "wtforms-json", + "xlsxwriter>=3.0.7, <3.1", + ], + extras_require={ + "athena": ["pyathena[pandas]>=2, <3"], + "aurora-data-api": ["preset-sqlalchemy-aurora-data-api>=0.2.8,<0.3"], + "bigquery": [ + "pandas-gbq>=0.19.1", + "sqlalchemy-bigquery>=1.6.1", + "google-cloud-bigquery>=3.10.0", + ], + "clickhouse": ["clickhouse-connect>=0.5.14, <1.0"], + "cockroachdb": ["cockroachdb>=0.3.5, <0.4"], + "cors": ["flask-cors>=2.0.0"], + "crate": ["crate[sqlalchemy]>=0.26.0, <0.27"], + "databricks": [ + "databricks-sql-connector>=2.0.2, <3", + "sqlalchemy-databricks>=0.2.0", + ], + "db2": ["ibm-db-sa>=0.3.5, <0.4"], + "dremio": ["sqlalchemy-dremio>=1.1.5, <1.3"], + "drill": ["sqlalchemy-drill==0.1.dev"], + "druid": ["pydruid>=0.6.5,<0.7"], + "dynamodb": ["pydynamodb>=0.4.2"], + "solr": ["sqlalchemy-solr >= 0.2.0"], + "elasticsearch": ["elasticsearch-dbapi>=0.2.9, <0.3.0"], + "exasol": ["sqlalchemy-exasol >= 2.4.0, <3.0"], + "excel": ["xlrd>=1.2.0, <1.3"], + "firebird": ["sqlalchemy-firebird>=0.7.0, <0.8"], + "firebolt": ["firebolt-sqlalchemy>=0.0.1"], + "gsheets": ["shillelagh[gsheetsapi]>=1.0.14, <2"], + "hana": ["hdbcli==2.4.162", "sqlalchemy_hana==0.4.0"], + "hive": ["pyhive[hive]@git+https://github.com/dropbox/PyHive.git@b3c123195b6d2586e1e609eefecafe036324eb46", "tableschema", "thrift>=0.14.1, <1.0.0"], + "impala": ["impyla>0.16.2, <0.17"], + "kusto": ["sqlalchemy-kusto>=2.0.0, <3"], + "kylin": ["kylinpy>=2.8.1, <2.9"], + "mssql": ["pymssql>=2.1.4, <2.2"], + "mysql": ["mysqlclient>=2.1.0, <3"], + "ocient": [ + "sqlalchemy-ocient>=1.0.0", + "pyocient>=1.0.15", + "shapely", + "geojson", + ], + "oracle": ["cx-Oracle>8.0.0, <8.1"], + "pinot": ["pinotdb>=0.3.3, <0.4"], + "postgres": ["psycopg2-binary==2.9.6"], + "presto": ["pyhive[presto]@git+https://github.com/dropbox/PyHive.git@b3c123195b6d2586e1e609eefecafe036324eb46"], + "trino": ["trino>=0.324.0"], + "prophet": ["prophet>=1.0.1, <1.1", "pystan<3.0"], + "redshift": ["sqlalchemy-redshift>=0.8.1, < 0.9"], + "rockset": ["rockset>=0.8.10, <0.9"], + "shillelagh": [ + "shillelagh[datasetteapi,gsheetsapi,socrata,weatherapi]>=1.1.1, <2" + ], + "snowflake": ["snowflake-sqlalchemy>=1.2.4, <2"], + "spark": ["pyhive[hive]@git+https://github.com/dropbox/PyHive.git@b3c123195b6d2586e1e609eefecafe036324eb46", "tableschema", "thrift>=0.14.1, <1.0.0"], + "teradata": ["teradatasql>=16.20.0.23"], + "thumbnails": ["Pillow>=9.5.0, <10.0.0"], + "vertica": ["sqlalchemy-vertica-python>=0.5.9, < 0.6"], + "netezza": ["nzalchemy>=11.0.2"], + }, + python_requires="~=3.9", + author="Apache Software Foundation", + author_email="dev@superset.apache.org", + url="https://superset.apache.org/", + download_url="https://www.apache.org/dist/superset/" + version_string, + classifiers=[ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + ], +) diff --git a/superset/common/chart_data.py b/superset/common/chart_data.py index 659a64015937..9963b95614d7 100644 --- a/superset/common/chart_data.py +++ b/superset/common/chart_data.py @@ -14,11 +14,17 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -from enum import Enum +try: + from enum import StrEnum +except ImportError: + from enum import Enum + class StrEnum(str, Enum): + pass + from typing import Set -class ChartDataResultFormat(str, Enum): +class ChartDataResultFormat(StrEnum): """ Chart data response format """ @@ -32,7 +38,7 @@ def table_like(cls) -> Set["ChartDataResultFormat"]: return {cls.CSV} | {cls.XLSX} -class ChartDataResultType(str, Enum): +class ChartDataResultType(StrEnum): """ Chart data response type """ diff --git a/superset/sql_parse.py b/superset/sql_parse.py index 323fabb3d3c1..58a88193edba 100644 --- a/superset/sql_parse.py +++ b/superset/sql_parse.py @@ -17,7 +17,14 @@ import logging import re from dataclasses import dataclass -from enum import Enum + +try: + from enum import StrEnum +except ImportError: + from enum import Enum + class StrEnum(str, Enum): + pass + from typing import Any, cast, Iterator, List, Optional, Set, Tuple from urllib import parse @@ -70,7 +77,7 @@ ) -class CtasMethod(str, Enum): +class CtasMethod(StrEnum): TABLE = "TABLE" VIEW = "VIEW" @@ -482,7 +489,7 @@ def sanitize_clause(clause: str) -> str: return clause -class InsertRLSState(str, Enum): +class InsertRLSState(StrEnum): """ State machine that scans for WHERE and ON clauses referencing tables. """