Properties

Inheritance diagram of dbt_contracts.properties.IndentedDumper, dbt_contracts.properties.PropertiesIO, dbt_contracts.properties.SafeLineLoader

Classes

IndentedDumper(stream[,Β default_style,Β ...])

YAML dumper which sets extra indentation for flow collections

PropertiesIO([data])

Manages loading and saving of properties for dbt objects from/to their associated properties files

SafeLineLoader(stream)

YAML safe loader which applies line and column number information to every mapping read.

class dbt_contracts.properties.SafeLineLoader(stream)

Bases: SafeLoader

YAML safe loader which applies line and column number information to every mapping read.

construct_mapping(node: MappingNode, deep: bool = False)

Construct mapping object and apply line and column numbers

class dbt_contracts.properties.IndentedDumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)

Bases: Dumper

YAML dumper which sets extra indentation for flow collections

increase_indent(flow=False, indentless=False)
class dbt_contracts.properties.PropertiesIO(data: dict[Path, dict[str, Any]] = None)

Bases: MutableMapping[Path, dict[str, Any]]

Manages loading and saving of properties for dbt objects from/to their associated properties files

static get_path(item: PropertiesT, to_absolute: bool = False) → Path | None

Get the properties path for a given item from its attributes.

Parameters:
  • item – The item to get a properties path for.

  • to_absolute – Format the path to be absolute. Only returns the path if it exists in the project.

Returns:

The properties path if found.

save(paths: Collection[Path] = ()) → list[Path]

Save the stored properties.

Parameters:

paths – Optionally, only save the properties from this list.