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-examplesscenario 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:
- The
retail_inventory_intelligencecollection - The
retail_inventoryandcompetitor_pricesdatasets - The
update_competitor_pricespipeline definition - The
inventory_overviewdashboard definition
3. Verify in portal
retail_inventory_intelligenceshows 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_priceis created
The detailed behavior of the datasets and pipeline continues in Workshop: Retail Inventory Intelligence.