From 74554f3973bddaafae9336b6042c9ea93d142296 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 20 Jun 2025 16:36:07 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Make=20excel=20df=20paths=20?= =?UTF-8?q?relative=20insetad=20of=20absolute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vuegen/streamlit_reportview.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vuegen/streamlit_reportview.py b/src/vuegen/streamlit_reportview.py index 8ed3a8e..55eac5a 100644 --- a/src/vuegen/streamlit_reportview.py +++ b/src/vuegen/streamlit_reportview.py @@ -746,14 +746,14 @@ def _generate_dataframe_content(self, dataframe) -> List[str]: r.DataFrameFormat.XLSX.value_with_dot, ]: dataframe_content.append("selected_sheet = 0") - sheet_names = table_utils.get_sheet_names(dataframe.file_path) + sheet_names = table_utils.get_sheet_names(df_file_path.as_posix()) if len(sheet_names) > 1: # If there are multiple sheets, ask the user to select one dataframe_content.append( textwrap.dedent( f"""\ - sheet_names = table_utils.get_sheet_names("{dataframe.file_path}") + sheet_names = table_utils.get_sheet_names("{df_file_path.as_posix()}") selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names) """ ) @@ -766,7 +766,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]: r.DataFrameFormat.XLSX.value_with_dot, ]: dataframe_content.append( - f"""df = pd.{read_function.__name__}('{dataframe.file_path}', sheet_name=selected_sheet)\n""" + f"""df = pd.{read_function.__name__}('{df_file_path.as_posix()}', sheet_name=selected_sheet)\n""" ) else: dataframe_content.append( From 0c1b33fdd037807bc9bbd9f596da77b9d1ef3fd5 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Sat, 21 Jun 2025 11:31:32 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=85=20update=20tests=20to=20match=20r?= =?UTF-8?q?elative=20paths=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../streamlit_report/sections/Dataframes/All_Formats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py b/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py index a26eb0a..5d60849 100644 --- a/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py +++ b/tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py @@ -30,10 +30,10 @@ df_index += 1 st.markdown('''

Abundance Table Example Xls

''', unsafe_allow_html=True) selected_sheet = 0 -sheet_names = table_utils.get_sheet_names("/home/runner/work/vuegen/vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls") +sheet_names = table_utils.get_sheet_names("docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls") selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names) -df = pd.read_excel('/home/runner/work/vuegen/vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls', sheet_name=selected_sheet) +df = pd.read_excel('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls', sheet_name=selected_sheet) # Displays a DataFrame using AgGrid with configurable options. @@ -103,7 +103,7 @@ df_index += 1 st.markdown('''

Example Xlsx

''', unsafe_allow_html=True) selected_sheet = 0 -df = pd.read_excel('/home/runner/work/vuegen/vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/5_example_xlsx.xlsx', sheet_name=selected_sheet) +df = pd.read_excel('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/5_example_xlsx.xlsx', sheet_name=selected_sheet) # Displays a DataFrame using AgGrid with configurable options.