From 1e5749ac3fcf195c82897f7d82734af12f9f0c6c Mon Sep 17 00:00:00 2001 From: Mumtoz Valijonov Date: Fri, 29 Apr 2022 11:48:50 +0500 Subject: [PATCH] Fix hello world --- examples/hello_world/prepare_data.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/hello_world/prepare_data.py b/examples/hello_world/prepare_data.py index 4737bd3f..37671a28 100644 --- a/examples/hello_world/prepare_data.py +++ b/examples/hello_world/prepare_data.py @@ -4,6 +4,12 @@ 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 @@ -11,10 +17,10 @@ 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"),