Superset series 1/6 — Setting up Superset

Teclead Ventures
4 min readMay 17, 2023

--

Teclead Ventures
We enable our enterprise clients to reach the mass market and digitalize internal and external businees processes. https://teclead-ventures.de/en

We are hiring!

Introduction

Superset is a powerful open-source tool for visualizing and exploring data, with a wide range of built-in charts, dashboards, and data sources. However, sometimes you may want to extend Superset’s functionality beyond what is available out of the box, and that’s where custom plugins come in.

Custom plugins allow you to add new visualizations, data sources, or even entire new features to Superset, tailored to your specific needs. Whether you want to integrate with a new data warehouse, create a custom chart type, or implement a custom authentication or authorization scheme, custom plugins offer a flexible and modular way to extend Superset’s capabilities.

This guide will walk you through the process of building your own custom plugins for Superset, from setting up your development environment to deploying your plugins to a production instance.

By the end of this series, you should be able to create your own custom plugins for Superset, opening up a world of possibilities for exploring and visualizing your data in new and innovative ways. So let’s get started!

Requirements

  • Make sure to stop any other superset non-related PostgreSQL instances
  • Node 16.9.1
  • Python 3.6 or newer

Version

In this Guide we are using Superset version 2.1.0

Result Repository

This Superset documentation series will guide you through each step of customizing Superset. If you’d like to use the results directly, you can clone our Git repository, which includes all changes made during the course of this guide:

(OPTIONAL)
git clone https://github.com/Teclead-Ventures/superset

Steps

First, we’ll walk through the steps to set up a new Superset project. We’ll cover the installation and configuration of the necessary dependencies.

  1. Navigate to a directory where you want to store superset then clone the superset repository using:
git clone https://github.com/apache/superset.git

2. Navigate into superset directory which you have cloned in step 1

cd superset

If you want to use the version 2.1.0 as well check out into the corresponding branch:

git checkout 2.1.0

3. Create a new virtual environment for Superset: This is the recommended approach. Each Python project should ideally have its own virtual environment to avoid package conflicts like these. If you’re using venv ( built into Python 3 ), you can do this:

python3 -m venv superset-env
source superset-env/bin/activate

4. Run the folowing command to create a secret key and a new file called superset_config.py

echo "SECRET_KEY = '$(openssl rand -base64 42)'" > superset_config.py

Save and close the file.

5. Then, you’ll need to install the required dependencies:

pip3 install -r requirements/base.txt

6. From Root run the following commands :

cd superset-frontend
npm i
npm run build
cd ..

7. Create a admin with the following command :

superset fab create-admin
  • It should prompt you to enter the details for the new admin user.
  • When it asks for the username, enter admin.
  • When it asks for the password, enter admin (or any other password you'd prefer).
  • Complete the rest of the prompts.

8. Now run the following superset commands from root :

superset load_examples
superset db upgrade
superset init
superset run -p 8088 --with-threads --reload --debugger

💡 This can take a couple of minutes to load, especially for the datasets

9. Now the project should be running on localhost:8088. Enter the following credentials to log in:

username: admin
password: admin
Login Screen

You can check if the datasets are loaded by navigating in the running superset instance to SQL → SQL Lab. From there you can check if the dataset is already listed in the SEE TABLE SCHEMA :

Here you can check the loaded datatsets, if they are shown you can use them for visualizations

And that is all you have to do to you use superset! In the next part of our superset series we discuss the controlpanel, which is an essential component for every plugin. After understanding how we can set queries using the controlpanel the following guides will dive into cloning, modifying and adding plugins.

Superset Controlpanel Part 2 : https://medium.com/@teclead-ventures/superset-series-2-6-control-panel-31a84afae465

Cloning Superset Plugins Part 3: https://medium.com/@teclead-ventures/superset-series-3-6-cloning-plugins-3336a8a979a0

Modifying Superset Plugins Part 4 : https://medium.com/@teclead-ventures/superset-series-4-6-modifying-plugins-abad61517230

Adding Superset Plugins Part 5 : https://medium.com/@teclead-ventures/superset-series-5-6-adding-plugins-4677c6a1ff5b

Visualizing Maps using Openlayers in Superset Part 6 : https://teclead-ventures.medium.com/superset-series-6-6-openlayers-map-visualization-e72e2976cfa0

Author : Daniel Jin Wodke

Editors: Ruben Karlsson, Matthias Daiber, Cherif Khlass, Lukas Zöllner, John Einicke

--

--

Teclead Ventures
Teclead Ventures

Written by Teclead Ventures

We enable our enterprise clients and our venture startups to reach the mass market and digitalize internal and external business processes.

No responses yet