Skip to content

Commit

Permalink
Merge branch 'apache:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfbolat authored Nov 16, 2023
2 parents 60f5d2c + d20b60e commit a219ac2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 58 deletions.
1 change: 1 addition & 0 deletions RESOURCES/INTHEWILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Join our growing community!
- [Steamroot](https://streamroot.io/)
- [TechAudit](https://www.techaudit.info) [@ETselikov]
- [Tenable](https://www.tenable.com) [@dflionis]
- [Tentacle](https://public.tentaclecmi.com) [@jdclarke5]
- [timbr.ai](https://timbr.ai/) [@semantiDan]
- [Tobii](http://www.tobii.com/) [@dwa]
- [Tooploox](https://www.tooploox.com/) [@jakubczaplicki]
Expand Down
1 change: 1 addition & 0 deletions docs/src/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ a > span > svg {
font-size: 14px;
font-weight: 400;
background-color: #fff;
transition: all 0.5s;

.get-started-button {
border-radius: 10px;
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ maintainers:
- name: craig-rueda
email: [email protected]
url: https://github.com/craig-rueda
version: 0.10.14
version: 0.10.15
dependencies:
- name: postgresql
version: 12.1.6
Expand Down
2 changes: 1 addition & 1 deletion helm/superset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NOTE: This file is generated by helm-docs: https://github.com/norwoodj/helm-docs

# superset

![Version: 0.10.14](https://img.shields.io/badge/Version-0.10.14-informational?style=flat-square)
![Version: 0.10.15](https://img.shields.io/badge/Version-0.10.15-informational?style=flat-square)

Apache Superset is a modern, enterprise-ready business intelligence web application

Expand Down
1 change: 1 addition & 0 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ spec:
metadata:
annotations:
checksum/superset_config.py: {{ include "superset-config" . | sha256sum }}
checksum/superset_bootstrap.sh: {{ tpl .Values.bootstrapScript . | sha256sum }}
checksum/connections: {{ .Values.supersetNode.connections | toYaml | sha256sum }}
checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
checksum/extraSecrets: {{ .Values.extraSecrets | toYaml | sha256sum }}
Expand Down
1 change: 1 addition & 0 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
metadata:
annotations:
checksum/superset_config.py: {{ include "superset-config" . | sha256sum }}
checksum/superset_bootstrap.sh: {{ tpl .Values.bootstrapScript . | sha256sum }}
checksum/connections: {{ .Values.supersetNode.connections | toYaml | sha256sum }}
checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
checksum/extraSecrets: {{ .Values.extraSecrets | toYaml | sha256sum }}
Expand Down
21 changes: 13 additions & 8 deletions superset-frontend/src/features/tags/TagModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ const TagModal: React.FC<TagModalProps> = ({
setSavedQueriesToTag([]);
};

const clearTagForm = () => {
setTagName('');
setDescription('');
setDashboardsToTag([]);
setChartsToTag([]);
setSavedQueriesToTag([]);
};

useEffect(() => {
const resourceMap: { [key: string]: TaggableResourceOption[] } = {
[TaggableResources.Dashboard]: [],
Expand Down Expand Up @@ -225,7 +233,9 @@ const TagModal: React.FC<TagModalProps> = ({
})
.then(({ json = {} }) => {
refreshData();
clearTagForm();
addSuccessToast(t('Tag updated'));
onHide();
})
.catch(err => {
addDangerToast(err.message || 'Error Updating Tag');
Expand All @@ -241,24 +251,19 @@ const TagModal: React.FC<TagModalProps> = ({
})
.then(({ json = {} }) => {
refreshData();
clearTagForm();
addSuccessToast(t('Tag created'));
onHide();
})
.catch(err => addDangerToast(err.message || 'Error Creating Tag'));
}
onHide();
};

return (
<Modal
title={modalTitle}
onHide={() => {
if (clearOnHide) {
setTagName('');
setDescription('');
setDashboardsToTag([]);
setChartsToTag([]);
setSavedQueriesToTag([]);
}
if (clearOnHide) clearTagForm();
onHide();
}}
show={show}
Expand Down
39 changes: 1 addition & 38 deletions superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
from sqlalchemy.engine import Connection, Engine
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.sql.type_api import Variant
from sqlalchemy.types import TEXT, TypeDecorator, TypeEngine
from sqlalchemy.types import TypeEngine
from typing_extensions import TypeGuard

from superset.constants import (
Expand Down Expand Up @@ -122,18 +122,6 @@
ADHOC_FILTERS_REGEX = re.compile("^adhoc_filters")


class LenientEnum(Enum):
"""Enums with a `get` method that convert a enum value to `Enum` if it is a
valid value."""

@classmethod
def get(cls, value: Any) -> Any:
try:
return super().__new__(cls, value)
except ValueError:
return None


class AdhocMetricExpressionType(StrEnum):
SIMPLE = "SIMPLE"
SQL = "SQL"
Expand Down Expand Up @@ -280,15 +268,6 @@ class PostProcessingContributionOrientation(StrEnum):
COLUMN = "column"


class QueryMode(str, LenientEnum):
"""
Whether the query runs on aggregate or returns raw records
"""

RAW = "raw"
AGGREGATE = "aggregate"


class QuerySource(Enum):
"""
The source of a SQL query.
Expand Down Expand Up @@ -454,22 +433,6 @@ def default(self, o: Any) -> dict[Any, Any] | str:
return json.JSONEncoder(sort_keys=True).default(o)


class JSONEncodedDict(TypeDecorator): # pylint: disable=abstract-method
"""Represents an immutable structure as a json-encoded string."""

impl = TEXT

def process_bind_param(
self, value: dict[Any, Any] | None, dialect: str
) -> str | None:
return json.dumps(value) if value is not None else None

def process_result_value(
self, value: str | None, dialect: str
) -> dict[Any, Any] | None:
return json.loads(value) if value is not None else None


def format_timedelta(time_delta: timedelta) -> str:
"""
Ensures negative time deltas are easily interpreted by humans
Expand Down
10 changes: 0 additions & 10 deletions tests/integration_tests/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
get_stacktrace,
json_int_dttm_ser,
json_iso_dttm_ser,
JSONEncodedDict,
merge_extra_filters,
merge_extra_form_data,
merge_request_params,
Expand Down Expand Up @@ -583,15 +582,6 @@ def test_format_timedelta(self):
"-16 days, 4:03:00",
)

def test_json_encoded_obj(self):
obj = {"a": 5, "b": ["a", "g", 5]}
val = '{"a": 5, "b": ["a", "g", 5]}'
jsonObj = JSONEncodedDict()
resp = jsonObj.process_bind_param(obj, "dialect")
self.assertIn('"a": 5', resp)
self.assertIn('"b": ["a", "g", 5]', resp)
self.assertEqual(jsonObj.process_result_value(val, "dialect"), obj)

def test_validate_json(self):
valid = '{"a": 5, "b": [1, 5, ["g", "h"]]}'
self.assertIsNone(validate_json(valid))
Expand Down

0 comments on commit a219ac2

Please sign in to comment.