Skip to content

Commit

Permalink
Remove option for skipping message verification in validator
Browse files Browse the repository at this point in the history
This also adds a short description of the functionality in PyRFLX.

Ref. eng/recordflux/RecordFlux!1456
  • Loading branch information
treiher committed Jan 22, 2024
1 parent 9824b59 commit bce42f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions rflx/pyrflx/pyrflx.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ def __init__(
checksum_functions: Optional[Mapping[StrID, Mapping[str, ChecksumFunction]]] = None,
skip_message_verification: bool = False,
) -> None:
"""
Initialize PyRFLX.
Arguments:
---------
model: The RecordFlux model.
checksum_functions: A mapping of field identifiers to checksum functions.
skip_message_verification: Disable some runtime checks for messages to optimize performance.
This can lead to unexpected errors if an invalid field value is
set.
"""
self._packages: dict[str, Package] = {}
messages: dict[ID, MessageValue] = {}

Expand Down
3 changes: 1 addition & 2 deletions rflx/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def __init__(
files: Iterable[Union[str, Path]],
checksum_module: Optional[str] = None,
cache: Optional[Cache] = None,
skip_message_verification: bool = False,
split_disjunctions: bool = False,
):
model = self._create_model(
Expand Down Expand Up @@ -57,7 +56,7 @@ def __init__(
)

try:
self._pyrflx = PyRFLX(model, checksum_functions, skip_message_verification)
self._pyrflx = PyRFLX(model, checksum_functions)
except PyRFLXError as e:
raise ValidationError(f"invalid checksum definition: {e}") from e

Expand Down
1 change: 0 additions & 1 deletion tests/unit/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def validator_mock(
files: object, # noqa: ARG001
checksum_module: Optional[str] = None, # noqa: ARG001
cache: Optional[object] = None, # noqa: ARG001
skip_message_verification: bool = False, # noqa: ARG001
split_disjunctions: bool = False, # noqa: ARG001
) -> None:
return None
Expand Down

0 comments on commit bce42f7

Please sign in to comment.