data_algebra/data_ops.py
def check_constraints(self, data_model, *, strict=True):
        """
        Check tables supplied meet data consistency constraints.

        data_model: dictionary of column name lists.
        """
        self.columns_used()  # for table consistency check/raise
        forbidden = self.forbidden_columns()
        tables = self.get_tables()
        missing_tables = set(tables.keys()) - set(data_model.keys())
        if len(missing_tables) > 0:
            raise ValueError("missing required tables: " + str(missing_tables))
        for k in tables.keys():
            have = set(data_model[k])
            td = tables[k]
            missing = set(td.column_names) - have
            if len(missing) > 0:
                raise ValueError(
                    "Table " + k + " missing required columns: " + str(missing)
                )
            if strict:
                cf = set(forbidden[k])
                excess = cf.intersection(have)
                if len(excess) > 0:
                    raise ValueError(
                        "Table " + k + " has forbidden columns: " + str(excess)
                    )

        Check tables supplied meet data consistency constraints.

        data_model: dictionary of column name lists.
        
Check tables supplied meet data consistency constraints.
data_model: dictionary of column name lists.
Check tables supplied meet data consistency constraints . data_model : dictionary of column name lists .
def check_constraints(self, data_model, *, strict=True):
        self.columns_used()  
        forbidden = self.forbidden_columns()
        tables = self.get_tables()
        missing_tables = set(tables.keys()) - set(data_model.keys())
        if len(missing_tables) > 0:
            raise ValueError("missing required tables: " + str(missing_tables))
        for k in tables.keys():
            have = set(data_model[k])
            td = tables[k]
            missing = set(td.column_names) - have
            if len(missing) > 0:
                raise ValueError(
                    "Table " + k + " missing required columns: " + str(missing)
                )
            if strict:
                cf = set(forbidden[k])
                excess = cf.intersection(have)
                if len(excess) > 0:
                    raise ValueError(
                        "Table " + k + " has forbidden columns: " + str(excess)
                    )
def check_constraints ( self , data_model , * , strict = True ) : self . columns_used ( ) forbidden = self . forbidden_columns ( ) tables = self . get_tables ( ) missing_tables = set ( tables . keys ( ) ) - set ( data_model . keys ( ) ) if len ( missing_tables ) > 0 : raise ValueError ( "missing required tables: " + str ( missing_tables ) ) for k in tables . keys ( ) : have = set ( data_model [ k ] ) td = tables [ k ] missing = set ( td . column_names ) - have if len ( missing ) > 0 : raise ValueError ( "Table " + k + " missing required columns: " + str ( missing ) ) if strict : cf = set ( forbidden [ k ] ) excess = cf . intersection ( have ) if len ( excess ) > 0 : raise ValueError ( "Table " + k + " has forbidden columns: " + str ( excess ) )
Check tables supplied meet data consistency constraints.
Check tables supplied meet data consistency constraints .
"""
        Check tables supplied meet data consistency constraints.

        data_model: dictionary of column name lists.
        """ # for table consistency check/raise
self
data_model
strict