From dc566814e0bb8d48f98f056c89cbbc62c0ab732a Mon Sep 17 00:00:00 2001 From: konstantin Date: Thu, 7 Nov 2024 17:17:50 +0100 Subject: [PATCH] fix: allow `EbdTable`s to have 0 rows (#291) Co-authored-by: Konstantin --- src/rebdhuhn/models/ebd_table.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rebdhuhn/models/ebd_table.py b/src/rebdhuhn/models/ebd_table.py index 767632e..d53c10e 100644 --- a/src/rebdhuhn/models/ebd_table.py +++ b/src/rebdhuhn/models/ebd_table.py @@ -219,15 +219,16 @@ class EbdTable: metadata: EbdTableMetaData = attrs.field(validator=attrs.validators.instance_of(EbdTableMetaData)) """ - meta data about the table + meta data about the table. """ rows: List[EbdTableRow] = attrs.field( validator=attrs.validators.deep_iterable( - member_validator=attrs.validators.instance_of(EbdTableRow), iterable_validator=attrs.validators.min_len(1) + member_validator=attrs.validators.instance_of(EbdTableRow), iterable_validator=attrs.validators.min_len(0) ), ) """ - rows are the body of the table + rows are the body of the table; + might have 0 rows, if the EBD exists but is just a paragraph of text, no real table """ # pylint: disable=duplicate-code multi_step_instructions: Optional[List[MultiStepInstruction]] = attrs.field(