diff --git a/cubes/server/blueprint.py b/cubes/server/blueprint.py index 1c3d3148..93b721e0 100644 --- a/cubes/server/blueprint.py +++ b/cubes/server/blueprint.py @@ -4,7 +4,7 @@ import traceback from collections import OrderedDict -from flask import Blueprint, Response, request, g, current_app, safe_join, make_response +from flask import Blueprint, Response, request, g, current_app from flask import render_template, redirect from ..workspace import Workspace, SLICER_INFO_KEYS 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"),