block_sources

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

block_sources(blocks: Sequence[DataFrame], context: Mapping[str, Any] | None, *, owner: str) → Tuple[str, ...][source]

Resolve the source label of each child block, in child order.

The tree wrapper normally supplies the labels through context["sources"] (a leaf’s as_ alias when set, else its modality, else the node name). When no context is available – a combiner called directly in a notebook – a single-column block falls back to its column name and anything else to block_{index}.

Parameters:
  • blocks – Child blocks in child order.

  • context – Evaluation context supplied by the tree wrapper, or None.

  • owner – Combiner name used in error messages.

Returns:

One source label per child block.

Raises:

HABITAPIError – If a supplied sources list does not match the block count.