From 1e5749ac3fcf195c82897f7d82734af12f9f0c6c Mon Sep 17 00:00:00 2001 From: Mumtoz Valijonov Date: Fri, 29 Apr 2022 11:48:50 +0500 Subject: [PATCH 1/2] 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"), From 39420318e82e75bac889d56bed1d78d96236d353 Mon Sep 17 00:00:00 2001 From: Mumtoz Valijonov Date: Fri, 29 Apr 2022 11:52:46 +0500 Subject: [PATCH 2/2] Remove unused conflicting import --- cubes/server/blueprint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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