Skip to content

Commit 44746f3

Browse files
committed
🐛 Correct relative paths for excel dataframes
1 parent e371f02 commit 44746f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vuegen/streamlit_reportview.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,14 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
755755
r.DataFrameFormat.XLSX.value_with_dot,
756756
]:
757757
dataframe_content.append("selected_sheet = 0")
758-
sheet_names = table_utils.get_sheet_names(dataframe.file_path)
758+
sheet_names = table_utils.get_sheet_names(df_file_path.as_posix())
759759
if len(sheet_names) > 1:
760760
# If there are multiple sheets, ask the user to select one
761761

762762
dataframe_content.append(
763763
textwrap.dedent(
764764
f"""\
765-
sheet_names = table_utils.get_sheet_names("{dataframe.file_path}")
765+
sheet_names = table_utils.get_sheet_names("{df_file_path.as_posix()}")
766766
selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names)
767767
"""
768768
)
@@ -775,7 +775,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
775775
r.DataFrameFormat.XLSX.value_with_dot,
776776
]:
777777
dataframe_content.append(
778-
f"""df = pd.{read_function.__name__}('{dataframe.file_path}', sheet_name=selected_sheet)\n"""
778+
f"""df = pd.{read_function.__name__}('{df_file_path.as_posix()}', sheet_name=selected_sheet)\n"""
779779
)
780780
else:
781781
dataframe_content.append(

0 commit comments

Comments
 (0)