bayesline.api.unwrap_valid

Contents

bayesline.api.unwrap_valid#

bayesline.api.unwrap_valid(result: SettingValid[T] | SettingInvalid | SettingNotFound | SettingNotPermissioned) DatasetAwareSettings[T]#

Convert a SettingResult[T] into the bare DatasetAwareSettings[T].

Raises on every non-valid discriminant.

Use this in read call sites that want the old “returns settings or throws” shape. Callers that need to handle invalid / not_found / not_permissioned rows distinctly should pattern-match on the discriminant directly instead.

Parameters#

resultSettingResult[T]

The settings result to unwrap.

Raises#

KeyError

If the settings result is a SettingNotFound.

PermissionError

If the settings result is a SettingNotPermissioned.

ValueError

If the settings result is a SettingInvalid.

AssertionError

If the settings result is of an unknown kind.

Returns#

DatasetAwareSettings[T]

The settings object.