easyfabric.data.model
json
logging
operator
re
dataclass
field
fields
Callable
Optional
ConfigManager
DataClassFromDictMixin
check_format
read_file_as_string
yaml_to_json
to_snake_case
def to_snake_case(string: str) -> str
Reference Objects
@dataclass
class Reference(DataClassFromDictMixin)
table
Loadsetting Objects
@dataclass
class Loadsetting(DataClassFromDictMixin)
notebook
loadactive
loadorder
Measures Objects
@dataclass
class Measures(DataClassFromDictMixin)
name
expression
description
formatstring
displayfolder
ishidden
Column Objects
@dataclass
class Column(DataClassFromDictMixin)
sourcecolumn
type
Partition Objects
@dataclass
class Partition(DataClassFromDictMixin)
partitionsource
processloadorder
Table Objects
@dataclass
class Table(DataClassFromDictMixin)
tabletype
name
sourceschema
sourcetable
references
columns
partitions
processloadorder
loadsettings
measures
surrogatekeyunknownvalue
keydatatype
get_table_abfs
def get_table_abfs(config_manager: ConfigManager)
get_table_fullname
def get_table_fullname(config_manager: ConfigManager)
get_sk_unknownvalue
def get_sk_unknownvalue(config_manager: ConfigManager)
Model Objects
@dataclass
class Model(DataClassFromDictMixin)
tables
__post_init__
def __post_init__()
get_table
def get_table(object_name: str) -> Optional[Table]
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.
dataclass
Optional
get_distinct_load_tuples
@staticmethod
def get_distinct_load_tuples(
tables: list[Table]
) -> list[tuple[str, str, Optional[str], Optional[int]]]
Updated for lowercase fields: (name, tabletype, notebook, load_order)
get_unique_load_combos
@staticmethod
def get_unique_load_combos(tables: list[Table]) -> list[dict[str, any]]
Extracts unique combinations of name, tabletype, loadsettings.notebook, and loadsettings.loadorder from a list of Tables. Flattens multiple Loadsettings per table.
Arguments:
tablesList[Table] - Input tables (e.g., dim_tables).
Returns:
List[Dict[str, any]]: List of unique dicts, e.g.,
[{'name'- 'customer_dim', 'tabletype': 'dim', 'notebook': 'load_bronze', 'loadorder': 1}, ...] Sorted by name, then loadorder for predictable looping.
Notes:
- Skips tables with no loadsettings.
- Duplicates (same combo across tables) are removed.
- If notebook or loadorder is None, it's included as-is.
from_yaml_file
@classmethod
def from_yaml_file(cls, file_path: str)
Create a Model instance from a YAML file.