Skip to content

Commit

Permalink
Merge branch 'pexdax/snowflake' into arash/refactorDBConnections
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Sep 29, 2021
2 parents e4410c5 + 9fa95ba commit 418a9d6
Show file tree
Hide file tree
Showing 51 changed files with 7,562 additions and 49,164 deletions.
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ labels: "#bug"

A clear and concise description of what the bug is.

#### How to reproduce the bug

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

### Expected results

what you expected to happen.
Expand All @@ -19,12 +26,6 @@ what actually happens.

If applicable, add screenshots to help explain your problem.

#### How to reproduce the bug

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

### Environment

Expand Down
68 changes: 68 additions & 0 deletions docs/src/pages/docs/Connecting to Databases/databricks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Databricks
menu: Connecting to Databases
route: /docs/databases/databricks
index: 30
version: 1
---

## Databricks

To connect to Databricks, first install [databricks-dbapi](https://pypi.org/project/databricks-dbapi/) with the optional SQLAlchemy dependencies:

```bash
pip install databricks-dbapi[sqlalchemy]
```

There are two ways to connect to Databricks: using a Hive connector or an ODBC connector. Both ways work similarly, but only ODBC can be used to connect to [SQL endpoints](https://docs.databricks.com/sql/admin/sql-endpoints.html).

### Hive

To use the Hive connector you need the following information from your cluster:

- Server hostname
- Port
- HTTP path

These can be found under "Configuration" -> "Advanced Options" -> "JDBC/ODBC".

You also need an access token from "Settings" -> "User Settings" -> "Access Tokens".

Once you have all this information, add a database of type "Databricks (Hive)" in Superset, and use the following SQLAlchemy URI:

```
databricks+pyhive://token:{access token}@{server hostname}:{port}/{database name}
```

You also need to add the following configuration to "Other" -> "Engine Parameters", with your HTTP path:

```
{"connect_args": {"http_path": "sql/protocolv1/o/****"}}
```

### ODBC

For ODBC you first need to install the [ODBC drivers for your platform](https://databricks.com/spark/odbc-drivers-download).

For a regular connection use this as the SQLAlchemy URI:

```
databricks+pyodbc://token:{access token}@{server hostname}:{port}/{database name}
```

And for the connection arguments:

```
{"connect_args": {"http_path": "sql/protocolv1/o/****", "driver_path": "/path/to/odbc/driver"}}
```

The driver path should be:

- `/Library/simba/spark/lib/libsparkodbc_sbu.dylib` (Mac OS)
- `/opt/simba/spark/lib/64/libsparkodbc_sb64.so` (Linux)

For a connection to a SQL endpoint you need to use the HTTP path from the endpoint:

```
{"connect_args": {"http_path": "/sql/1.0/endpoints/****", "driver_path": "/path/to/odbc/driver"}}
```
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: [email protected]
url: https://github.com/craig-rueda
version: 0.3.9
version: 0.3.10
dependencies:
- name: postgresql
version: 10.2.0
Expand Down
5 changes: 3 additions & 2 deletions helm/superset/templates/deployment-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ spec:
env:
- name: "SUPERSET_PORT"
value: {{ .Values.service.port | quote}}
{{- if .Values.extraEnv }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.extraEnvRaw }}
{{- toYaml .Values.extraEnvRaw | nindent 12 }}
{{- end }}
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . | quote }}
Expand Down
5 changes: 3 additions & 2 deletions helm/superset/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ spec:
env:
- name: "SUPERSET_PORT"
value: {{ .Values.service.port | quote}}
{{- if .Values.extraEnv }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.extraEnvRaw }}
{{- toYaml .Values.extraEnvRaw | nindent 12 }}
{{- end }}
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . | quote }}
Expand Down
7 changes: 3 additions & 4 deletions helm/superset/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,17 @@ spec:
env:
- name: "SUPERSET_PORT"
value: {{ .Values.service.port | quote}}
{{- if .Values.extraEnv }}
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.supersetNode.env }}
{{- range $key, $value := .Values.supersetNode.env }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.extraEnvRaw }}
{{- toYaml .Values.extraEnvRaw | nindent 12 }}
{{- end }}
envFrom:
- secretRef:
name: {{ tpl .Values.envFromSecret . | quote }}
Expand Down
5 changes: 4 additions & 1 deletion helm/superset/templates/init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ spec:
containers:
- name: {{ template "superset.name" . }}-init-db
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{ if .Values.extraEnv }}
{{- if or .Values.extraEnv .Values.extraEnvRaw }}
env:
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.extraEnvRaw }}
{{- toYaml .Values.extraEnvRaw | nindent 10 }}
{{- end }}
{{- end }}
envFrom:
- secretRef:
Expand Down
12 changes: 11 additions & 1 deletion helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,21 @@ extraEnv: {}
# GUNICORN_TIMEOUT: 300


# OAUTH_HOME_DOMAIN: ..
# OAUTH_HOME_DOMAIN: ..
# # If a whitelist is not set, any address that can use your OAuth2 endpoint will be able to login.
# # this includes any random Gmail address if your OAuth2 Web App is set to External.
# OAUTH_WHITELIST_REGEX: ...

## Extra environment variables in RAW format that will be passed into pods
##
extraEnvRaw: []
# Load DB password from other secret (e.g. for zalando operator)
# - name: DB_PASS
# valueFrom:
# secretKeyRef:
# name: superset.superset-postgres.credentials.postgresql.acid.zalan.do
# key: password

## Extra environment variables to pass as secrets
##
extraSecretEnv: {}
Expand Down
6 changes: 4 additions & 2 deletions superset-frontend/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ const path = require('path');
const customConfig = require('../webpack.config.js');

module.exports = {
core: {
builder: 'webpack5',
},
stories: ['../src/@(components|common|filters)/**/*.stories.@(t|j)sx'],
addons: [
'@storybook/addon-essentials',
'@storybook/addon-links',
'@storybook/preset-typescript',
'storybook-addon-jsx',
'@storybook/addon-knobs/register',
'@storybook/addon-knobs',
'storybook-addon-paddings',
],
webpackFinal: config => ({
Expand Down
19 changes: 11 additions & 8 deletions superset-frontend/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React from 'react';
import { addDecorator } from '@storybook/react';
import { jsxDecorator } from 'storybook-addon-jsx';
import { addParameters } from '@storybook/react';
import { withPaddings } from 'storybook-addon-paddings';
import WithPaddings from 'storybook-addon-paddings';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import { combineReducers, createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
Expand Down Expand Up @@ -49,15 +49,18 @@ const providerDecorator = Story => (
addDecorator(jsxDecorator);
addDecorator(themeDecorator);
addDecorator(providerDecorator);
addDecorator(withPaddings);
addDecorator(WithPaddings);

addParameters({
paddings: [
{ name: 'None', value: '0px' },
{ name: 'Small', value: '16px' },
{ name: 'Medium', value: '32px', default: true },
{ name: 'Large', value: '64px' },
],
paddings: {
values: [
{ name: 'None', value: '0px' },
{ name: 'Small', value: '16px' },
{ name: 'Medium', value: '32px' },
{ name: 'Large', value: '64px' },
],
default: 'Medium',
},
options: {
storySort: {
method: 'alphabetical',
Expand Down
Loading

0 comments on commit 418a9d6

Please sign in to comment.