Equals#
synthesized.common.rules.Equals
- class Equals(v1, v2)#
Asserts that two columns or values must be equal in generation.
- Parameters
v1 (GenericRule) – A generic rule that may represent a value or column.
v2 (GenericRule) – A second generic rule that may represent a value or column.
Methods
filter
(df)Remove rows in a dataframe that are not valid under the rule.
get_augment_func
(inverse, **kwargs)Return the functions needed to augment the dataframe so that the rule is covered.
get_children
()- rtype
List
[GenericRule
]
set_meta
(df_meta)to_pd_str
(df_name)Get the pandas statement to be evaluated for this rule
Get the SQL statement to be evaluated for this rule
- filter(df)#
Remove rows in a dataframe that are not valid under the rule.
- Parameters
df (pd.DataFrame) – Data to filter.
- Return type
DataFrame
- Returns
DataFrame with rows removed that are not valid under the rule.
- get_augment_func(inverse, **kwargs)#
Return the functions needed to augment the dataframe so that the rule is covered.
The returned object is a Dict[str, Callable], where keys are the columns where the result of the function in the values will be applied.
For example, if get_augment_func returns
{col_name: func}
, it will be applied as >>> df[col_name] = df.apply(func, axis=1)- Return type
Dict
[str
,Callable
]
- to_pd_str(df_name)#
Get the pandas statement to be evaluated for this rule
- Return type
str
- to_sql_str()#
Get the SQL statement to be evaluated for this rule
- Return type
str