Skip to content

create_path_config

Public callable

Create environment-to-target routing used by Fabric IO helpers.

Use this in the 00_env_config bootstrap stage to define which workspace/lakehouse/warehouse targets are valid for each environment (for example, dev and prod).

Parameters:

Name Type Description Default
paths dict[str, dict[str, Any]]

Mapping of environment names to target mappings. Each target value is typically a Housepath-compatible object used later by :func:get_path and read/write helpers.

required

Returns:

Type Description
PathConfig

Immutable path configuration wrapper.

Raises:

Type Description
ValueError

Raised when paths is empty or not a mapping.

Examples:

>>> create_path_config({"dev": {"raw": object()}}).paths["dev"] is not None
True
Source code in src/fabricops_kit/config.py
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
def create_path_config(paths: dict[str, dict[str, Any]]) -> PathConfig:
    """Create environment-to-target routing used by Fabric IO helpers.

    Use this in the ``00_env_config`` bootstrap stage to define which
    workspace/lakehouse/warehouse targets are valid for each environment
    (for example, ``dev`` and ``prod``).

    Parameters
    ----------
    paths : dict[str, dict[str, Any]]
        Mapping of environment names to target mappings. Each target value is
        typically a ``Housepath``-compatible object used later by
        :func:`get_path` and read/write helpers.

    Returns
    -------
    PathConfig
        Immutable path configuration wrapper.

    Raises
    ------
    ValueError
        Raised when ``paths`` is empty or not a mapping.

    Examples
    --------
    >>> create_path_config({"dev": {"raw": object()}}).paths["dev"] is not None
    True
    """
    if not isinstance(paths, dict) or not paths:
        raise ValueError("paths must be a non-empty mapping of environments to targets.")
    return PathConfig(paths=paths)