Skip to content

definitions

Sample Dagster assets that mirror a Power BI deployment structure.

These definitions intentionally remain lightweight: the semantic model asset simulates an expensive refresh, while the downstream AssetSpec objects model dashboards that depend on the shared semantic model. In production a factory would emit these assets based on Power BI metadata, but the stubs provide realistic wiring for demos and integration tests.

bi_sm_core_semantic_model(context)

Refresh the sample Power BI semantic model used by downstream dashboards.

Parameters:

Name Type Description Default
context AssetExecutionContext

Dagster execution context supplied by the runtime. The handler is used exclusively for structured logging in this stub implementation.

required

Returns:

Name Type Description
None None

The asset does not produce any materialization payload; Dagster tracks completion based on the asset invocation finishing without raising an error.

Source code in data_foundation/defs/powerbi/definitions.py
@dg.asset(
    key=["bi", "sm", "core_semantic_model"],
    deps=[["common", "fct", "fct_transactions"], ["common", "dim", "dim_customers"]],
    owners=["analytics@email.com"],
    kinds={"powerbi"},
    group_name="bi",
    automation_condition=dg.AutomationCondition.eager(),
    description="This is the core semantic model that is used by business "
    "leadership to self serve analytics",
)
def bi_sm_core_semantic_model(context: dg.AssetExecutionContext) -> None:
    """Refresh the sample Power BI semantic model used by downstream dashboards.

    Args:
        context: Dagster execution context supplied by the runtime. The handler is
            used exclusively for structured logging in this stub implementation.

    Returns:
        None: The asset does not produce any materialization payload; Dagster tracks
            completion based on the asset invocation finishing without raising an error.
    """
    context.log.info("refreshing powerbi semantic model")
    sleep(10)
    context.log.info("refresh complete")
    return None