[docs]@dataclass(frozen=True)classLinkMethod(StrEnum):"""Available assignment methods to link a child to its parent table after the anonymization."""LINEAR_SUM_ASSIGNMENT="linear_sum_assignment""""Assign using the linear sum assignment algorithm. This method is a good privacy and utility trade-off. The algorithm consumes lots of resources. """MINIMUM_DISTANCE_ASSIGNMENT="minimum_distance_assignment""""Assign using the minimum distance assignment algorithm. This method assigns the closest child to the parent. It is an acceptable privacy and utility trade-off. This algorithm consumes less resources than the linear sum assignment."""SENSITIVE_ORIGINAL_ORDER_ASSIGNMENT="sensitive_original_order_assignment""""Assign the child to the parent using the original order. WARNING!!! This method is a HIGH PRIVACY BREACH as it keeps the original order to assign the child to the parent. This method isn't recommended for privacy reasons but consumes less resources than the other methods."""TIME_SERIES="time_series""""Specific assignment method for time series data. It is used to link time series data to the parent table."""
@dataclass(frozen=True)classTableLinkInfoSpec:"""Destination part of a table link."""table:strfield:str@dataclass(frozen=True)classTableLinkInfo:"""A link from a field to a field in another table."""field:strto:TableLinkInfoSpecmethod:LinkMethod@dataclass(frozen=False)classTableInfo:name:strdata:TableDataInfo|None=Noneindividual_level:bool|None=Noneavatars_data:TableDataInfo|None=Nonecolumns:list[ColumnInfo]|None=Nonelinks:list[TableLinkInfo]|None=None@dataclass(frozen=True)classSchemaSpec:tables:list[TableInfo]schema_ref:str|None=None@dataclass(frozen=True)classSchema:kind:ModelKindmetadata:Metadataspec:SchemaSpecdefget_schema(name:str,tables:list[TableInfo],schema_ref:str|None=None)->Schema:returnSchema(kind=ModelKind.SCHEMA,metadata=Metadata(name=name),spec=SchemaSpec(tables=tables,schema_ref=schema_ref,),)