본문으로 건너뛰기
advanced
10

Quick scenario import (advanced, 10 min)

Load a single dhub2-examples scenario into portal with the Python automation tool. The contributor / engineer view of the scenario import flow.

This Tutorial is written from the contributor / engineer point of view — for people who want to contribute scenarios to dhub2-examples or wire up the import flow as part of an automation. The analyst-facing click-based import flow lives in Import a scenario zip in one shot (KO only for now).

By the end of this Tutorial

  • You'll understand what the dhub2-examples scenario import tool creates.
  • You'll import your first scenario into portal and verify the result in the collection tree.

1. Set up the environment

git clone https://github.com/<your-org>/dhub2-examples.git
cd dhub2-examples
python -m venv .venv && source .venv/bin/activate
pip install -r tools/requirements.txt

Put your portal access info in .env.local:

DHUB2_PORTAL_URL=https://portal.dhub2.example.com
DHUB2_API_TOKEN=<your-token>

2. Import the scenario

python tools/import.py scenarios/retail_inventory_intelligence

The script creates the following, in order:

  1. The retail_inventory_intelligence collection
  2. The retail_inventory and competitor_prices datasets
  3. The update_competitor_prices pipeline definition
  4. The inventory_overview dashboard definition

3. Verify in portal

  • retail_inventory_intelligence shows up in the collection tree on the left right away
  • Row counts on both datasets are greater than zero
  • After one pipeline run, update_competitor_price is created

The detailed behavior of the datasets and pipeline continues in Workshop: Retail Inventory Intelligence.