Utils
Functions
|
Convert the given value to a tuple |
|
Recursively update a given |
|
Check whether the given |
Get the absolute path of the given relative |
- dbt_contracts.contracts.utils.to_tuple(value: Any) tuple
Convert the given value to a tuple
- dbt_contracts.contracts.utils.merge_maps(source: T, new: Mapping, extend: bool = True, overwrite: bool = False) T
Recursively update a given
sourcemap in place with anewmap.- Parameters:
source – The source map.
new – The new map with values to update for the source map.
extend – When a value is a list and a list is already present in the source map, extend the list when True. When False, only replace the list if overwrite is True.
overwrite – When True, overwrite any value in the source destructively.
- Returns:
The updated dict.
- dbt_contracts.contracts.utils.get_matching_catalog_table(item: NodeT, catalog: CatalogArtifact) CatalogTable | None
Check whether the given
itemexists in the database.- Parameters:
item – The resource to match.
catalog – The catalog of tables.
- Returns:
The matching catalog table.
- dbt_contracts.contracts.utils.get_absolute_project_path(path: str | Path) Path | None
Get the absolute path of the given relative
pathin the project directory. Only returns the path if it exists.- Parameters:
path – The relative path.
- Returns:
The absolute project path.