From 4b0e852372225b6e24ef5096c6d50ade1374a07c Mon Sep 17 00:00:00 2001 From: Julian Teichgraeber Date: Tue, 23 Jan 2024 11:39:17 +0000 Subject: [PATCH] fix streamlit local runner --- .flake8 | 1 + .../streamlit/streamlit_utils.py | 29 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.flake8 b/.flake8 index 48d8ff1..867a443 100644 --- a/.flake8 +++ b/.flake8 @@ -15,3 +15,4 @@ per-file-ignores = tw_experimentation/streamlit/pages_wrap/page1_Data_Loading.py:E501 tw_experimentation/streamlit/pages_wrap/page5_Experiment_Evaluation_Bayesian.py:E501 tw_experimentation/streamlit/Main.py:E501 + tw_experimentation/streamlit/streamlit_utils.py:E402 diff --git a/tw_experimentation/streamlit/streamlit_utils.py b/tw_experimentation/streamlit/streamlit_utils.py index b0b42b2..584fc54 100644 --- a/tw_experimentation/streamlit/streamlit_utils.py +++ b/tw_experimentation/streamlit/streamlit_utils.py @@ -1,9 +1,8 @@ -# import sys, os, pathlib +import sys +import os -# root_path = os.path.realpath("../..") -# sys.path.insert(0, root_path) - -# sys.path.append(str(pathlib.Path().absolute()).split("/tw_experimentation")[0]) +root_path = os.path.realpath("../..") +sys.path.insert(0, root_path) from tw_experimentation.utils import ExperimentDataset from tw_experimentation.statistical_tests import ( @@ -31,16 +30,6 @@ ) from tw_experimentation.bayes.bayes_test import BayesTest -import streamlit as st - -import pandas as pd -from scipy.stats import chi2_contingency -from snowflake.sqlalchemy import URL -from sqlalchemy import create_engine -import json - -from typing import Optional, List, Union - from tw_experimentation.constants import ( COLORSCALES, ACCOUNT, @@ -57,6 +46,16 @@ RESULT_TABLE, ) +import streamlit as st + +import pandas as pd +from scipy.stats import chi2_contingency +from snowflake.sqlalchemy import URL +from sqlalchemy import create_engine +import json + +from typing import Optional, List, Union + def fetch_data_from_table_name(warehouse: str, schema: str, table: str): st.session_state["sf_table_import"] = "Not implemented yet"