saltext.github.utils

saltext.github.utils.filter_unset(data: Mapping[K, V | None], unset: None = None) → dict[K, V][source]
saltext.github.utils.filter_unset(data: Mapping[K, V | EllipsisType], unset: EllipsisType) → dict[K, V]
saltext.github.utils.filter_unset(data: Mapping[K, V], unset: object) → dict[K, V]

Remove all unset values in a dictionary and return the filtered result.

data

Dictionary to filter.

unset

Identity of what counts as unset; evaluated via is not. Defaults to None. Other working examples: ... (ellipsis), a specific object such as salt.defaults.NOT_SET or a string literal (not recommended though).

saltext.github.utils.filter_fields(data, fields)[source]

Reduce the entities in a collection to a subset of their fields.

data

List of mappings or mapping of key to mapping.

fields

Single field name or list of field names. A list reduces each entity to a mapping of the listed fields, a single name to the field’s value. None (the default) returns data unchanged.