Skip to content

Commit 26388f0

Browse files
committed
🐛 using the dataframe while qmd generation, need to redefine path
- loading sheets on report generation makes it necessary have the path w.r.t to the folder on report generation - qmd notebook is moved to quart_report folder in outfolder, where the path is needed To check if this works fine with output folder definitions...
1 parent aa2ba13 commit 26388f0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/vuegen/quarto_reportview.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
745745
df_file_path = dataframe.file_path
746746
else:
747747
df_file_path = get_relative_file_path(
748-
dataframe.file_path, base_path=".."
748+
dataframe.file_path,
749749
)
750750
sheet_names = None
751751
# If the file is an Excel file, get the sheet names
@@ -763,6 +763,13 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
763763
else:
764764
sheet_names = None
765765

766+
# Build the file path (URL or local file)
767+
if is_url(dataframe.file_path):
768+
df_file_path = dataframe.file_path
769+
else:
770+
df_file_path = get_relative_file_path(
771+
dataframe.file_path, base_path=".."
772+
)
766773
# Load the DataFrame using the correct function
767774
read_function = read_function_mapping[file_extension]
768775
dataframe_content.append(

0 commit comments

Comments
 (0)