Skip to content

Commit

Permalink
Merge branch 'master' into refactor/ResultSet-to-fc
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneTorap committed Aug 31, 2022
2 parents a5e6079 + 0c87ff7 commit cf55134
Show file tree
Hide file tree
Showing 135 changed files with 4,400 additions and 1,040 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/chromatic-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# .github/workflows/chromatic.yml
# seee https://www.chromatic.com/docs/github-actions
#
# 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.
#

# Workflow name
name: 'Chromatic Storybook Master'

# Event for the workflow
# Only run if changes were made in superset-frontend folder of repo on merge to Master
on:
# This will trigger when a branch merges to master when the PR has changes in the frontend folder updating the chromatic baseline
push:
branches:
- master
paths:
- "superset-frontend/**"

# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: npm ci
working-directory: superset-frontend
# 👇 Build and publish Storybook to Chromatic
- name: Build and publish Storybook to Chromatic
id: chromatic-master
uses: chromaui/action@v1
# Required options for the Chromatic GitHub Action
with:
# 👇 Location of package.json from root of mono-repo
workingDir: superset-frontend
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
autoAcceptChanges: true # 👈 Option to accept all changes when merging to master
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,22 @@
#

# Workflow name
name: 'Chromatic'
name: 'Chromatic Pull Request'

# Event for the workflow
# Only run if changes were made in superset-frontend folder of repo
# This will allow us to see how the Storybook builds when a PR has been created that has changes in the frontend folder
# NOTE: pull_request_target actions will always run the version of this action on master branch
# you will not see changes in the action behavior until this action's changes have been merged to master.
# This is a security precaution so that PR coming from a fork cannot access a Github secret without a repo
# committer aproving and merging the PR declaring the action safe.
on:
# This will trigger when a branch merges to master when the PR has changes in the frontend folder updating the chromatic baseline
push:
branches:
- master
paths:
- "superset-frontend/**"
# this will allow us to see how the Storybook builds when a PR has been created that has changes in the frontend folder
# NOTE: pull_request_target actions will always run the version of this action on master branch
# you will not see changes in the action behavior until this action's changes have been merged to master.
# This is a security precaution so that PR coming from a fork cannot access a Github secret without a repo
# committer aproving and merging the PR declaring the action safe.
pull_request_target:

# We want this action to run under specific pull request changes
# opened: pull request is created
# synchronize: commit(s) pushed to the pull request
# reopened: closed pull request is reopened
types: [opened, synchronize, reopened]
# This action will only run if one or more files have changes under the superset-frontend folder
paths:
- "superset-frontend/**"

Expand All @@ -48,39 +42,37 @@ jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# define outputs that can be used in the storybook-link-comment job
outputs:
storybookUrl: ${{ steps.chromatic-deploy.outputs.storybookUrl }}
buildUrl: ${{ steps.chromatic-deploy.outputs.buildUrl }}
# Job steps
steps:
- id: chromatic-deploy
- uses: actions/checkout@v1
- name: Install dependencies
run: npm ci
working-directory: superset-frontend
# 👇 Checks if the branch is not master and runs Chromatic
- name: Publish to Chromatic
id: chromatic-pr
if: github.ref != 'refs/heads/master'
uses: chromaui/action@v1
# Required options for the Chromatic GitHub Action
with:
# 👇 Location of package.json from root of mono-repo
workingDir: superset-frontend
# 👇 Chromatic projectToken, refer to the Chromatic manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
# 👇 Checks if the branch is master and accepts all changes in Chromatic
- name: Publish to Chromatic and auto accept changes
id: chromatic-master
if: github.ref == 'refs/heads/master'
# 👇 Build and publish Storybook to Chromatic
- name: Build and publish Storybook to Chromatic
id: chromatic-deploy
uses: chromaui/action@v1
# Required options for the Chromatic GitHub Action
with:
# 👇 Location of package.json from root of mono-repo
workingDir: superset-frontend
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: true # 👈 Option to accept all changes when merging to master
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing when changes are detected

# Put a comment on the PR with link to latest build of the Storybook for this branch
storybook-link-comment:
# Operating System
runs-on: ubuntu-latest
# job steps
needs: chromatic-deployment
steps:
- name: Echo Storybook build link
if: ${{ success() }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -89,5 +81,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Storybook has completed and can be viewed at ${{ steps.chromatic-pr.outputs.storybookUrl }}'
body: 'Storybook has completed and can be viewed at ${{ needs.chromatic-deployment.outputs.storybookUrl }} Chromatic visual test results can be viewed at ${{ needs.chromatic-deployment.outputs.buildUrl }}'
})
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ Here are some of the major database solutions that are supported:
<img src="superset-frontend/src/assets/images/teradata.png" alt="teradata" border="0" width="200" height="80"/>
<img src="superset-frontend/src/assets/images/yugabyte.png" alt="yugabyte" border="0" width="200" height="80"/>
</p>
**A more comprehensive list of supported databases** along with the configuration instructions can be found
[here](https://superset.apache.org/docs/databases/installing-database-drivers).

**A more comprehensive list of supported databases** along with the configuration instructions can be found [here](https://superset.apache.org/docs/databases/installing-database-drivers).

Want to add support for your datastore or data engine? Read more [here](https://superset.apache.org/docs/frequently-asked-questions#does-superset-work-with-insert-database-engine-here) about the technical requirements.

Expand Down
10 changes: 10 additions & 0 deletions docker/pythonpath_dev/superset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def get_env_variable(var_name: str, default: Optional[str] = None) -> str:

RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab")

CACHE_CONFIG = {
"CACHE_TYPE": "redis",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
"CACHE_REDIS_HOST": REDIS_HOST,
"CACHE_REDIS_PORT": REDIS_PORT,
"CACHE_REDIS_DB": REDIS_RESULTS_DB,
}
DATA_CACHE_CONFIG = CACHE_CONFIG


class CeleryConfig(object):
BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
Expand Down
8 changes: 3 additions & 5 deletions docs/docs/databases/clickhouse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ version: 1

## ClickHouse

To use ClickHouse with Superset, you will need to add the following Python libraries:
To use ClickHouse with Superset, you will need to add the following Python library:

```
clickhouse-driver==0.2.0
clickhouse-sqlalchemy==0.1.6
clickhouse-sqlalchemy>=0.2.2
```

If running Superset using Docker Compose, add the following to your `./docker/requirements-local.txt` file:

```
clickhouse-driver>=0.2.0
clickhouse-sqlalchemy>=0.1.6
clickhouse-sqlalchemy>=0.2.2
```

The recommended connector library for ClickHouse is
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/databases/installing-database-drivers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ A list of some of the recommended packages.
| [Ascend.io](/docs/databases/ascend) | `pip install impyla` | `ascend://{username}:{password}@{hostname}:{port}/{database}?auth_mechanism=PLAIN;use_ssl=true` |
| [Azure MS SQL](/docs/databases/sql-server) | `pip install pymssql` | `mssql+pymssql://UserName@presetSQL:[email protected]:1433/TestSchema` |
| [Big Query](/docs/databases/bigquery) | `pip install pybigquery` | `bigquery://{project_id}` |
| [ClickHouse](/docs/databases/clickhouse) | `pip install clickhouse-driver==0.2.0 && pip install clickhouse-sqlalchemy==0.1.6` | `clickhouse+native://{username}:{password}@{hostname}:{port}/{database}` |
| [ClickHouse](/docs/databases/clickhouse) | `pip install clickhouse-sqlalchemy` | `clickhouse+native://{username}:{password}@{hostname}:{port}/{database}` |
| [CockroachDB](/docs/databases/cockroachdb) | `pip install cockroachdb` | `cockroachdb://root@{hostname}:{port}/{database}?sslmode=disable` |
| [Dremio](/docs/databases/dremio) | `pip install sqlalchemy_dremio` | `dremio://user:pwd@host:31010/` |
| [Elasticsearch](/docs/databases/elasticsearch) | `pip install elasticsearch-dbapi` | `elasticsearch+http://{user}:{password}@{host}:9200/` |
Expand Down
18 changes: 16 additions & 2 deletions docs/docs/databases/trino.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ In `Secure Extra` field, config as following example:

All fields in `auth_params` are passed directly to the [`KerberosAuthentication`](https://github.com/trinodb/trino-python-client/blob/0.306.0/trino/auth.py#L40) class.

#### 3. JWT Authentication
#### 3. Certificate Authentication
In `Secure Extra` field, config as following example:
```json
{
"auth_method": "certificate",
"auth_params": {
"cert": "/path/to/cert.pem",
"key": "/path/to/key.pem"
}
}
```

All fields in `auth_params` are passed directly to the [`CertificateAuthentication`](https://github.com/trinodb/trino-python-client/blob/0.315.0/trino/auth.py#L416) class.

#### 4. JWT Authentication
Config `auth_method` and provide token in `Secure Extra` field
```json
{
Expand All @@ -67,7 +81,7 @@ Config `auth_method` and provide token in `Secure Extra` field
}
```

#### 4. Custom Authentication
#### 5. Custom Authentication
To use custom authentication, first you need to add it into
`ALLOWED_EXTRA_AUTHENTICATIONS` allow list in Superset config file:
```python
Expand Down
Loading

0 comments on commit cf55134

Please sign in to comment.