|
11 | 11 |
|
12 | 12 | import polars as pl |
13 | 13 |
|
14 | | -from ._rule import GroupRule, Rule, with_evaluation_rules |
| 14 | +from ._rule import GroupRule, Rule |
15 | 15 | from .columns import Column |
16 | | -from .exc import ImplementationError, RuleImplementationError |
| 16 | +from .exc import ImplementationError |
17 | 17 |
|
18 | 18 | _COLUMN_ATTR = "__dataframely_columns__" |
19 | 19 | _RULE_ATTR = "__dataframely_rules__" |
@@ -112,23 +112,6 @@ def __new__( |
112 | 112 | f"which are not in the schema: {missing_list}." |
113 | 113 | ) |
114 | 114 |
|
115 | | - # 3) Assuming that non-custom rules are implemented correctly, we check that all |
116 | | - # custom rules are _also_ implemented correctly by evaluating rules on an |
117 | | - # empty data frame and checking for the evaluated dtypes. |
118 | | - if len(result.rules) > 0: |
119 | | - lf_empty = pl.LazyFrame( |
120 | | - schema={col_name: col.dtype for col_name, col in result.columns.items()} |
121 | | - ) |
122 | | - # NOTE: For some reason, `polars` does not yield correct dtypes when calling |
123 | | - # `collect_schema()` |
124 | | - schema = with_evaluation_rules(lf_empty, result.rules).collect().schema |
125 | | - for rule_name, rule in result.rules.items(): |
126 | | - dtype = schema[rule_name] |
127 | | - if not isinstance(dtype, pl.Boolean): |
128 | | - raise RuleImplementationError( |
129 | | - rule_name, dtype, isinstance(rule, GroupRule) |
130 | | - ) |
131 | | - |
132 | 115 | return super().__new__(mcs, name, bases, namespace, *args, **kwargs) |
133 | 116 |
|
134 | 117 | def __getattribute__(cls, name: str) -> Any: |
|
0 commit comments