Skip to content

Commit 8a38944

Browse files
committed
🐛 Fix(report): Add XLSX format in DataFrameFormat Enum and update st and quarto reports
1 parent 4a8512c commit 8a38944

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

vuegen/config_generator.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def infer_title_from_file_dir_name(filename: str) -> str:
2626
return title.replace("_", " ").title()
2727

2828

29-
def infer_component_metadata(file: Path, logger=None) -> Dict[str, Union[str, None]]:
29+
def infer_component_metadata(file: Path, logger=None) -> Dict[str, str]:
3030
"""
3131
Infers metadata for a file, including component type, plot type, and additional fields.
3232
@@ -39,7 +39,7 @@ def infer_component_metadata(file: Path, logger=None) -> Dict[str, Union[str, No
3939
4040
Returns
4141
-------
42-
Dict[str, Union[str, None]]
42+
Dict[str,str]
4343
A dictionary containing inferred metadata.
4444
"""
4545
ext = file.suffix.lower()
@@ -123,16 +123,14 @@ def get_sort_key(item: Path) -> tuple:
123123

124124
return sorted(items, key=get_sort_key)
125125

126-
def generate_subsection_data(subsection_folder: Path, base_folder: Path) -> Dict[str, Union[str, List[Dict]]]:
126+
def generate_subsection_data(subsection_folder: Path) -> Dict[str, Union[str, List[Dict]]]:
127127
"""
128128
Generates data for a single subsection.
129129
130130
Parameters
131131
----------
132132
subsection_folder : Path
133133
Path to the subsection folder.
134-
base_folder : Path
135-
The base folder path to ensure proper path calculation.
136134
137135
Returns
138136
-------

vuegen/quarto_reportview.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ def _generate_dataframe_content(self, dataframe, is_report_static) -> List[str]:
396396
r.DataFrameFormat.CSV.value_with_dot: pd.read_csv,
397397
r.DataFrameFormat.PARQUET.value_with_dot: pd.read_parquet,
398398
r.DataFrameFormat.TXT.value_with_dot: pd.read_table,
399-
r.DataFrameFormat.XLS.value_with_dot: pd.read_excel
399+
r.DataFrameFormat.XLS.value_with_dot: pd.read_excel,
400+
r.DataFrameFormat.XLSX.value_with_dot: pd.read_excel
400401
}
401402
try:
402403
# Check if the file extension matches any DataFrameFormat value

vuegen/report.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class DataFrameFormat(StrEnum):
6363
TXT = auto()
6464
PARQUET = auto()
6565
XLS = auto()
66+
XLSX = auto()
6667

6768
@property
6869
def value_with_dot(self):

vuegen/streamlit_reportview.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,8 @@ def _generate_dataframe_content(self, dataframe) -> List[str]:
429429
r.DataFrameFormat.CSV.value_with_dot: pd.read_csv,
430430
r.DataFrameFormat.PARQUET.value_with_dot: pd.read_parquet,
431431
r.DataFrameFormat.TXT.value_with_dot: pd.read_table,
432-
r.DataFrameFormat.XLS.value_with_dot: pd.read_excel
432+
r.DataFrameFormat.XLS.value_with_dot: pd.read_excel,
433+
r.DataFrameFormat.XLSX.value_with_dot: pd.read_excel
433434
}
434435

435436
try:

0 commit comments

Comments
 (0)