Skip to main content

common_schemas

Config YAML specification classes that are common to multiple other uses.

Classes

DataSplitConfig

class DataSplitConfig(data_splitter: str = 'percentage', args: _JSONDict = {}):

Configuration for the data splitter.

Variables

  • static data_splitter : str

FilePath

class FilePath(    *,    load_default: typing.Any = <marshmallow.missing>,    missing: typing.Any = <marshmallow.missing>,    dump_default: typing.Any = <marshmallow.missing>,    default: typing.Any = <marshmallow.missing>,    data_key: str | None = None,    attribute: str | None = None,    validate: None | typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]] = None,    required: bool = False,    allow_none: bool | None = None,    load_only: bool = False,    dump_only: bool = False,    error_messages: dict[str, str] | None = None,    metadata: typing.Mapping[str, typing.Any] | None = None,    **additional_metadata,):

Field for representing file paths.

Serializes to a string representation of the path and deserializes to a Python pathlib representation.

Ancestors

Variables

  • static default_error_messages

ModelReference

class ModelReference(    *,    load_default: typing.Any = <marshmallow.missing>,    missing: typing.Any = <marshmallow.missing>,    dump_default: typing.Any = <marshmallow.missing>,    default: typing.Any = <marshmallow.missing>,    data_key: str | None = None,    attribute: str | None = None,    validate: None | typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]] = None,    required: bool = False,    allow_none: bool | None = None,    load_only: bool = False,    dump_only: bool = False,    error_messages: dict[str, str] | None = None,    metadata: typing.Mapping[str, typing.Any] | None = None,    **additional_metadata,):

Field for representing model references.

If the reference is a path to a file (and that file exists), deserializes a Path instance. Otherwise, deserializes the str reference unchanged.

Serializes both path and str to string.

Ancestors

Variables

  • static default_error_messages

PathConfig

class PathConfig(path: Path):

Configuration for the path.

Variables

TemplatedGroupingConfig

class TemplatedGroupingConfig(    group_by: list[str] | None,    order_by: list[tuple[str, str]] | None = None,    per_group_head: dict[str, int] | None = None,    include_non_new_group_files: bool = True,):

Configuration for grouping files into cohorts for processing.

Variables

  • static group_by : Optional[list[str]]
  • static include_non_new_group_files : bool
  • static order_by : list[tuple[str, str]] | None
  • static per_group_head : dict[str, int] | None

TemplatedOrTyped

class TemplatedOrTyped(inner_field: fields.Field, **kwargs: Any):

A field that accepts either a templated string or the expected type.

This field allows YAML validation to pass for both templated strings (like {{ variable_name }}) and the actual expected type, helping with YAML linting for template files.

The templated string must match the pattern: {{ variable_name }}

Initialize with the inner field type.

Arguments

  • inner_field: The actual field type expected when not templated
  • ****kwargs**: Additional keyword arguments passed to parent

Ancestors

Variables

  • static TEMPLATE_PATTERN