Skip to content

Commit 9697346

Browse files
authored
Merge branch 'main' into fix_empty_report_w_one_section
2 parents f8b5148 + e151711 commit 9697346

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/vuegen/streamlit_reportview.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,14 +740,14 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
740740
r.DataFrameFormat.XLSX.value_with_dot,
741741
]:
742742
dataframe_content.append("selected_sheet = 0")
743-
sheet_names = table_utils.get_sheet_names(dataframe.file_path)
743+
sheet_names = table_utils.get_sheet_names(df_file_path.as_posix())
744744
if len(sheet_names) > 1:
745745
# If there are multiple sheets, ask the user to select one
746746

747747
dataframe_content.append(
748748
textwrap.dedent(
749749
f"""\
750-
sheet_names = table_utils.get_sheet_names("{dataframe.file_path}")
750+
sheet_names = table_utils.get_sheet_names("{df_file_path.as_posix()}")
751751
selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names)
752752
"""
753753
)
@@ -760,7 +760,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
760760
r.DataFrameFormat.XLSX.value_with_dot,
761761
]:
762762
dataframe_content.append(
763-
f"""df = pd.{read_function.__name__}('{dataframe.file_path}', sheet_name=selected_sheet)\n"""
763+
f"""df = pd.{read_function.__name__}('{df_file_path.as_posix()}', sheet_name=selected_sheet)\n"""
764764
)
765765
else:
766766
dataframe_content.append(

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
df_index += 1
3131
st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Abundance Table Example Xls</h4>''', unsafe_allow_html=True)
3232
selected_sheet = 0
33-
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")
33+
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")
3434
selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names)
3535

36-
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)
36+
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)
3737

3838

3939
# Displays a DataFrame using AgGrid with configurable options.
@@ -103,7 +103,7 @@
103103
df_index += 1
104104
st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Example Xlsx</h4>''', unsafe_allow_html=True)
105105
selected_sheet = 0
106-
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)
106+
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)
107107

108108

109109
# Displays a DataFrame using AgGrid with configurable options.

0 commit comments

Comments
 (0)