easyfabric.data.model
Reference Objects
@dataclass
class Reference(DataClassFromDictMixin)
Table relationship reference in an analytical model.
Points to another table that this table has a relationship with (e.g. a dimension referenced by a fact table).
LoadSettingRow Objects
@dataclass
class LoadSettingRow(DataClassFromDictMixin)
One load setting of one table, flattened for iteration.
Measures Objects
@dataclass
class Measures(DataClassFromDictMixin)
DAX measure definition for an analytical model.
Holds the measure name, DAX expression, format string, and display folder for use in tabular model deploymentThe process of "pushing a button" to make your configuration actual, working software in the cloud..
Column Objects
@dataclass
class Column(DataClassFromDictMixin)
Model column with source mapping and data type.
Represents a column in a model table. A column is either source-backed
(sourcecolumn) or a calculated column defined by a DAX expression.
Partition Objects
@dataclass
class Partition(DataClassFromDictMixin)
Table partition definition for an analytical model.
Specifies the partition source query and processing load order for partitioned table refreshes.
Table Objects
@dataclass
class Table(DataClassFromDictMixin)
Model table definition (fact or dimension).
Represents a table in an analytical model with its columns, measures, partitions, relationships, and load settings.
Model Objects
@dataclass
class Model(DataClassFromDictMixin)
Analytical model definition with tables, columns, measures, and relationships.
Loaded from a YAMLA simple way to write configurations. It's basically a list that computers can read easily. model file, this is the top-level container for a tabular model's structure used during gold-layer deployment.
get_table
def get_table(object_name: str) -> Optional[Table]
Find a table by its name or source table name.
Arguments:
object_name- The table name or source table name to search for (case-insensitive).
Returns:
The matching Table, or None if not found.
get_tables_lambda_filter
def get_tables_lambda_filter(
filter_func: Callable[[Table], bool]) -> list[Table]
Generic filter using a callable (e.g., for complex logic).
get_tables_by_field_filter
def get_tables_by_field_filter(field: str,
value: str,
op: str = "==") -> list[Table]
Filters tables by a specific field and value using operator.
Arguments:
fieldstr - Attribute name, e.g., 'tabletype'.valuestr - Target value, e.g., 'dim'.opstr - Operator like '==', '!=', '>' (default '==').
Returns:
List[Table]- Filtered tables.
get_load_settings
@staticmethod
def get_load_settings(tables: list[Table]) -> list[LoadSettingRow]
Flatten the load settings of the given tables into unique, ordered rows.
Carries loadactive rather than acting on it, so the caller decides what
a setting the model switched off should mean. A setting without a notebook
drives no load and is left out. Rows are unique over all five fields and
ordered by table name, then load order.
Arguments:
tableslist[Table] - Tables whose load settings to flatten.
Returns:
list[LoadSettingRow]- (name, tabletype, notebook, loadactive, loadorder).
from_yaml_file
@classmethod
def from_yaml_file(cls, file_path: str)
Create a Model instance from a YAML file.