Skip to content

Refresh Policy#

Bases: SsasEditableRecord

TBD.

SSAS spec: Microsoft This class represents the refresh policy for a partition in a Tabular model.

Source code in pbi_core/ssas/model_tables/refresh_policy/refresh_policy.py
@define()
class RefreshPolicy(SsasEditableRecord):
    """TBD.

    SSAS spec: [Microsoft](https://learn.microsoft.com/en-us/openspecs/sql_server_protocols/ms-ssas-t/e11ae511-5064-470b-8abc-e2a4dd3999e6)
    This class represents the refresh policy for a partition in a Tabular model.
    """

    incremental_granularity: Granularity = field(eq=True)
    incremental_periods: int = field(eq=True)
    incremental_periods_offset: int = field(eq=True)
    mode: RefreshMode = field(eq=True)
    policy_type: PolicyType = field(eq=True)
    polling_expression: str = field(eq=True)
    rolling_window_granularity: Granularity = field(eq=True)
    rolling_window_periods: int = field(eq=True)
    source_expression: str = field(eq=True)
    table_id: int = field(eq=True)

    _commands: BaseCommands = field(default=SsasCommands.refresh_policy, init=False, repr=False, eq=False)

    def table(self) -> "Table":
        return self._tabular_model.tables.find(self.table_id)

    def parents_base(self) -> frozenset[LinkedEntity]:
        return LinkedEntity.from_iter({self.table()}, by="table")