Skip to content

Commit

Permalink
Fix Type Hints of file_type; It's a list of, not a single export type
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein committed May 20, 2024
1 parent a42f3ea commit 6135c2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/kohlrahbi/ahb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ def process_ahb_table(
ahb_table: AhbTable,
pruefi: str,
output_path: Path,
file_type: str,
file_type: list[AhbExportFileFormat],
) -> None:
"""
Process the ahb table.
"""
unfolded_ahb = UnfoldedAhb.from_ahb_table(ahb_table=ahb_table, pruefi=pruefi)

if "xlsx" in file_type:
if AhbExportFileFormat.XLSX in file_type:
unfolded_ahb.dump_xlsx(output_path)
if "flatahb" in file_type:
if AhbExportFileFormat.FLATAHB in file_type:
unfolded_ahb.dump_flatahb_json(output_path)
if "csv" in file_type:
if AhbExportFileFormat.CSV in file_type:
unfolded_ahb.dump_csv(output_path)


Expand Down Expand Up @@ -92,12 +92,11 @@ def validate_pruefis(pruefis: list[str]) -> list[str]:
return valid_pruefis


# pylint: disable=too-many-arguments
def process_pruefi(
pruefi: str,
path_to_ahb_docx_file: Path,
output_path: Path,
file_type: str,
file_type: list[AhbExportFileFormat],
) -> None:
"""
Process one pruefi.
Expand Down Expand Up @@ -214,7 +213,7 @@ def scrape_pruefis(
pruefis: list[str],
basic_input_path: Path,
output_path: Path,
file_type: AhbExportFileFormat,
file_type: list[AhbExportFileFormat],
format_version: EdifactFormatVersion,
) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/kohlrahbi/ahb/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def ahb(
pruefis: list[str],
edi_energy_mirror_path: Path,
output_path: Path,
file_type: AhbExportFileFormat,
file_type: list[AhbExportFileFormat],
format_version: EdifactFormatVersion | str,
assume_yes: bool, # pylint: disable=unused-argument
# it is used by the callback function of the output-path
Expand Down

0 comments on commit 6135c2e

Please sign in to comment.