Skip to content

Commit 74554f3

Browse files
committed
🐛 Make excel df paths relative insetad of absolute
1 parent 954110a commit 74554f3

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
@@ -746,14 +746,14 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
746746
r.DataFrameFormat.XLSX.value_with_dot,
747747
]:
748748
dataframe_content.append("selected_sheet = 0")
749-
sheet_names = table_utils.get_sheet_names(dataframe.file_path)
749+
sheet_names = table_utils.get_sheet_names(df_file_path.as_posix())
750750
if len(sheet_names) > 1:
751751
# If there are multiple sheets, ask the user to select one
752752

753753
dataframe_content.append(
754754
textwrap.dedent(
755755
f"""\
756-
sheet_names = table_utils.get_sheet_names("{dataframe.file_path}")
756+
sheet_names = table_utils.get_sheet_names("{df_file_path.as_posix()}")
757757
selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names)
758758
"""
759759
)
@@ -766,7 +766,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
766766
r.DataFrameFormat.XLSX.value_with_dot,
767767
]:
768768
dataframe_content.append(
769-
f"""df = pd.{read_function.__name__}('{dataframe.file_path}', sheet_name=selected_sheet)\n"""
769+
f"""df = pd.{read_function.__name__}('{df_file_path.as_posix()}', sheet_name=selected_sheet)\n"""
770770
)
771771
else:
772772
dataframe_content.append(

0 commit comments

Comments
 (0)