Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/apache/superset into pexd…
Browse files Browse the repository at this point in the history
…ax/db-connection-ui
  • Loading branch information
hughhhh committed May 27, 2021
2 parents 7cb4098 + 281d637 commit 5a785d7
Show file tree
Hide file tree
Showing 66 changed files with 1,673 additions and 934 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ ENV LANG=C.UTF-8 \
SUPERSET_HOME="/app/superset_home" \
SUPERSET_PORT=8088

RUN useradd --user-group --no-create-home --no-log-init --shell /bin/bash superset \
&& mkdir -p ${SUPERSET_HOME} ${PYTHONPATH} \
RUN useradd --user-group -d ${SUPERSET_HOME} --no-log-init --shell /bin/bash superset \
&& mkdir -p ${PYTHONPATH} \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
build-essential \
Expand Down
11 changes: 6 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.
#
x-superset-image: &superset-image apache/superset:latest-dev
x-superset-user: &superset-user root
x-superset-depends-on: &superset-depends-on
- db
- redis
Expand Down Expand Up @@ -55,7 +56,7 @@ services:
restart: unless-stopped
ports:
- 8088:8088
user: "root"
user: *superset-user
depends_on: *superset-depends-on
volumes: *superset-volumes
environment:
Expand Down Expand Up @@ -95,7 +96,7 @@ services:
command: ["/app/docker/docker-init.sh"]
env_file: docker/.env
depends_on: *superset-depends-on
user: "root"
user: *superset-user
volumes: *superset-volumes
environment:
CYPRESS_CONFIG: "${CYPRESS_CONFIG}"
Expand All @@ -115,7 +116,7 @@ services:
env_file: docker/.env
restart: unless-stopped
depends_on: *superset-depends-on
user: "root"
user: *superset-user
volumes: *superset-volumes

superset-worker-beat:
Expand All @@ -125,7 +126,7 @@ services:
env_file: docker/.env
restart: unless-stopped
depends_on: *superset-depends-on
user: "root"
user: *superset-user
volumes: *superset-volumes

superset-tests-worker:
Expand All @@ -141,7 +142,7 @@ services:
REDIS_HOST: localhost
network_mode: host
depends_on: *superset-depends-on
user: "root"
user: *superset-user
volumes: *superset-volumes

volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [[ "${1}" == "worker" ]]; then
celery worker --app=superset.tasks.celery_app:app -Ofair -l INFO
elif [[ "${1}" == "beat" ]]; then
echo "Starting Celery beat..."
celery beat --app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid -l INFO
celery beat --app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid -l INFO -s "${SUPERSET_HOME}"/celerybeat-schedule
elif [[ "${1}" == "app" ]]; then
echo "Starting web app..."
flask run -p 8088 --with-threads --reload --debugger --host=0.0.0.0
Expand Down
10 changes: 8 additions & 2 deletions docs/src/pages/docs/Connecting to Databases/mysql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ version: 1

## MySQL

The recommended connector library for MySQL is [mysql-connector-python](https://pypi.org/project/mysql-connector-python/).
The recommended connector library for MySQL is `[mysqlclient](https://pypi.org/project/mysqlclient/)`.

Here's the connection string:

```
mysql+mysqlconnector://{username}:{password}@{host}/{database}
mysql://{username}:{password}@{host}/{database}
```

Host:
- For Localhost or Docker running Linux: `localhost` or `127.0.0.1`
- For On Prem: IP address or Host name
- For Docker running in OSX: `docker.for.mac.host.internal`
Port: `3306` by default

One problem with `mysqlclient` is that it will fail to connect to newer MySQL databases using `caching_sha2_password` for authentication, since the plugin is not included in the client. In this case, you should use `[mysql-connector-python](https://pypi.org/project/mysql-connector-python/)` instead:

```
mysql+mysqlconnector://{username}:{password}@{host}/{database}
```
2 changes: 1 addition & 1 deletion helm/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers:
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
version: 0.1.2
version: 0.1.3
dependencies:
- name: postgresql
version: 10.2.0
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
volumes:
- name: superset-config
secret:
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
volumes:
- name: superset-config
secret:
Expand Down
5 changes: 5 additions & 0 deletions helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}

volumes:
- name: superset-config
secret:
Expand Down
4 changes: 4 additions & 0 deletions helm/superset/templates/init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ spec:
command: {{ tpl (toJson .Values.init.command) . }}
resources:
{{ toYaml .Values.init.resources | indent 10 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
volumes:
- name: superset-config
secret:
Expand Down
3 changes: 3 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ image:
tag: latest
pullPolicy: IfNotPresent

imagePullSecrets: []


service:
type: ClusterIP
port: 8088
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe('Dashboard filter', () => {
}
expect(requestFilter).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ describe('Dashboard tabs', () => {
const requestParams = JSON.parse(requestBody.form_data as string);
expect(requestParams.extra_filters[0]).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
});
});
Expand All @@ -136,8 +136,8 @@ describe('Dashboard tabs', () => {
const requestParams = JSON.parse(requestBody.form_data as string);
expect(requestParams.extra_filters[0]).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
expect(requestParams.viz_type).eq(LINE_CHART.viz);
});
Expand All @@ -150,8 +150,8 @@ describe('Dashboard tabs', () => {
cy.wait('@v1ChartData').then(({ request }) => {
expect(request.body.queries[0].filters[0]).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Visualization > Line', () => {
it('should show validator error when no metric', () => {
const formData = { ...LINE_CHART_DEFAULTS, metrics: [] };
cy.visitChartByParams(JSON.stringify(formData));
cy.get('.ant-alert-warning').contains(`"Metrics" cannot be empty`);
cy.get('.ant-alert-warning').contains(`Metrics: cannot be empty`);
});

it('should preload mathjs', () => {
Expand All @@ -43,7 +43,7 @@ describe('Visualization > Line', () => {
it('should not show validator error when metric added', () => {
const formData = { ...LINE_CHART_DEFAULTS, metrics: [] };
cy.visitChartByParams(JSON.stringify(formData));
cy.get('.ant-alert-warning').contains(`"Metrics" cannot be empty`);
cy.get('.ant-alert-warning').contains(`Metrics: cannot be empty`);
cy.get('.text-danger').contains('Metrics');

cy.get('[data-test=metrics]')
Expand All @@ -62,6 +62,8 @@ describe('Visualization > Line', () => {
});

it('should allow negative values in Y bounds', () => {
const formData = { ...LINE_CHART_DEFAULTS, metrics: [NUM_METRIC] };
cy.visitChartByParams(JSON.stringify(formData));
cy.get('#controlSections-tab-display').click();
cy.get('span').contains('Y Axis Bounds').scrollIntoView();
cy.get('input[placeholder="Min"]').type('-0.1', { delay: 100 });
Expand Down
Loading

0 comments on commit 5a785d7

Please sign in to comment.