Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions examples/hello_world/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@

from sqlalchemy import create_engine
from cubes.tutorial.sql import create_table_from_csv
from pathlib import Path


cur_folder = Path(__file__).parent
csv_path = cur_folder / 'data.csv'
sqlite_path = cur_folder / 'data.sqlite'

# 1. Prepare SQL data in memory

FACT_TABLE = "irbd_balance"

print("preparing data...")

engine = create_engine('sqlite:///data.sqlite')
engine = create_engine(f'sqlite:///{sqlite_path}')

create_table_from_csv(engine,
"data.csv",
str(csv_path),
table_name=FACT_TABLE,
fields=[
("category", "string"),
Expand Down