MaxRowsPerGroupPerID#

from tmlt.analytics import MaxRowsPerGroupPerID
class tmlt.analytics.MaxRowsPerGroupPerID(grouping_column, max)#

Bases: Constraint

A constraint limiting rows per unique (ID, grouping column) pair in a table.

For example, MaxRowsPerGroupPerID("group_col", 5) guarantees that each ID appears in at most five rows for each distinct value in group_col.

grouping_column: str#

Name of column defining the groups to truncate.

max: int#

The maximum number of times each distinct value may appear in the column.

__post_init__()#

Check constructor arguments.