Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/tomlkit-0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein committed Jul 11, 2024
2 parents e6f1cdc + cf2e14e commit a8e724a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/kohlrahbi/ahb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ def extract_pruefis_from_table(table: Table) -> list[str]:

def table_header_contains_text_pruefidentifikator(table: Table) -> bool:
"""Checks if the table header contains the text 'Prüfidentifikator'."""
return table.row_cells(0)[-1].paragraphs[-1].text.startswith("Prüfidentifikator") # type:ignore[no-any-return]
pattern = r"Prüfidentifikator(?:\t){0,10}\t\d+"
# "matches "Prüfidentifikator" followed by at least 1 tab separated numbers, max 11 pruefis is chosen arbitrarily
return bool(re.search(pattern, table.row_cells(0)[-1].text))


def get_pruefi_to_file_mapping(basic_input_path: Path, format_version: EdifactFormatVersion) -> dict[str, str]:
Expand Down

0 comments on commit a8e724a

Please sign in to comment.