Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test pure sasl with hive python 3.11 #24155

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/superset-python-presto-hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]
env:
PYTHONPATH: ${{ github.workspace }}
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]
env:
PYTHONPATH: ${{ github.workspace }}
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
Expand Down
8 changes: 1 addition & 7 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ humanize==3.11.0
# via apache-superset
idna==3.2
# via email-validator
importlib-metadata==6.6.0
# via flask
importlib-resources==5.12.0
# via limits
isodate==0.6.0
Expand Down Expand Up @@ -314,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
Expand All @@ -326,10 +324,6 @@ wtforms-json==0.3.5
# via apache-superset
xlsxwriter==3.0.7
# via apache-superset
zipp==3.15.0
# via
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
52 changes: 26 additions & 26 deletions requirements/development.in
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#
# 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.
#
-r base.in
-e .[cors,druid,hive,mysql,postgres,thumbnails]
ipython
progress>=1.5,<2
pyinstrument>=4.0.2,<5
pylint==2.9.6
setuptools>=65.5.1
sqloxide
#
# 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.
#
-r base.in
-e .[cors,druid,hive,mysql,postgres,thumbnails]
ipython
progress>=1.5,<2
pyinstrument>=4.0.2,<5
pylint==2.15.0
setuptools>=65.5.1
sqloxide
22 changes: 12 additions & 10 deletions requirements/development.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:6d10e2cb134133e823edef48aa3e33b2b1b85681
# SHA1:4c968a12954870dc2461956c6fccb6a1065404fd
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -10,9 +10,7 @@
# via
# -r requirements/base.in
# -r requirements/development.in
appnope==0.1.3
# via ipython
astroid==2.6.6
astroid==2.13.5
# via pylint
asttokens==2.2.1
# via stack-data
Expand All @@ -34,6 +32,8 @@ 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
Expand Down Expand Up @@ -76,6 +76,8 @@ pickleshare==0.7.5
# via ipython
pillow==9.5.0
# via apache-superset
platformdirs==3.5.3
# via pylint
progress==1.6
# via -r requirements/development.in
psycopg2-binary==2.9.6
Expand All @@ -85,14 +87,16 @@ ptyprocess==0.7.0
pure-eval==0.2.2
# via stack-data
pure-sasl==0.6.2
# via thrift-sasl
# via
# pyhive
# thrift-sasl
pydruid==0.6.5
# via apache-superset
pyhive[hive]==0.6.5
pyhive @ git+https://github.com/dropbox/PyHive.git@e38eb23fb41ade5991d9fe4507c551962a693951
# via apache-superset
pyinstrument==4.4.0
# via -r requirements/development.in
pylint==2.9.6
pylint==2.15.0
# via -r requirements/development.in
requests==2.30.0
# via
Expand All @@ -103,8 +107,6 @@ 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
Expand All @@ -120,7 +122,7 @@ thrift==0.16.0
# thrift-sasl
thrift-sasl==0.4.3
# via pyhive
toml==0.10.2
tomlkit==0.11.8
# via pylint
traitlets==5.9.0
# via
Expand Down
6 changes: 3 additions & 3 deletions requirements/integration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ packaging==23.1
# pyproject-api
# tox
pip-compile-multi==2.6.3
# via -r integration.in
# via -r requirements/integration.in
pip-tools==6.13.0
# via pip-compile-multi
platformdirs==3.5.3
Expand All @@ -45,7 +45,7 @@ platformdirs==3.5.3
pluggy==1.0.0
# via tox
pre-commit==3.3.2
# via -r integration.in
# via -r requirements/integration.in
pyproject-api==1.5.1
# via tox
pyproject-hooks==1.0.0
Expand All @@ -55,7 +55,7 @@ pyyaml==5.4.1
toposort==1.10
# via pip-compile-multi
tox==4.6.1
# via -r integration.in
# via -r requirements/integration.in
virtualenv==20.23.0
# via
# pre-commit
Expand Down
4 changes: 0 additions & 4 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_git_sha() -> str:
"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"],
"hive": ["pyhive[hive_pure_sasl]@git+https://github.com/dropbox/PyHive.git@e38eb23fb41ade5991d9fe4507c551962a693951", "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"],
Expand All @@ -173,7 +173,7 @@ def get_git_sha() -> str:
"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"],
"presto": ["pyhive[presto]@git+https://github.com/dropbox/PyHive.git@e38eb23fb41ade5991d9fe4507c551962a693951"],
"trino": ["trino>=0.324.0"],
"prophet": ["prophet>=1.0.1, <1.1", "pystan<3.0"],
"redshift": ["sqlalchemy-redshift>=0.8.1, < 0.9"],
Expand All @@ -182,7 +182,7 @@ def get_git_sha() -> str:
"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"],
"spark": ["pyhive[hive_pure_sasl]@git+https://github.com/dropbox/PyHive.git@e38eb23fb41ade5991d9fe4507c551962a693951", "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"],
Expand Down
14 changes: 11 additions & 3 deletions superset/common/chart_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
# 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

class ChartDataResultFormat(str, Enum):
from typing import Set


class ChartDataResultFormat(StrEnum):
"""
Chart data response format
"""
Expand All @@ -31,7 +39,7 @@ def table_like(cls) -> set["ChartDataResultFormat"]:
return {cls.CSV} | {cls.XLSX}


class ChartDataResultType(str, Enum):
class ChartDataResultType(StrEnum):
"""
Chart data response type
"""
Expand Down
15 changes: 12 additions & 3 deletions superset/sql_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@
import re
from collections.abc import Iterator
from dataclasses import dataclass
from enum import Enum
from typing import Any, cast, Optional

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

import sqlparse
Expand Down Expand Up @@ -71,7 +80,7 @@
lex.set_SQL_REGEX(sqlparser_sql_regex)


class CtasMethod(str, Enum):
class CtasMethod(StrEnum):
TABLE = "TABLE"
VIEW = "VIEW"

Expand Down Expand Up @@ -483,7 +492,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.
"""
Expand Down