Skip to content

Commit 82bec0c

Browse files
committed
fix: deleted duplicate dataclass and enums from registry
1 parent d47eb8b commit 82bec0c

File tree

1 file changed

+5
-42
lines changed

1 file changed

+5
-42
lines changed

dataframe_expectations/registry.py

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,17 @@
11
import re
2-
from enum import Enum
32
from typing import Any, Callable, Dict, Optional
43

5-
from pydantic import BaseModel, ConfigDict, Field
6-
74
from dataframe_expectations.core.expectation import DataFrameExpectation
5+
from dataframe_expectations.core.types import (
6+
ExpectationCategory,
7+
ExpectationMetadata,
8+
ExpectationSubcategory,
9+
)
810
from dataframe_expectations.logging_utils import setup_logger
911

1012
logger = setup_logger(__name__)
1113

1214

13-
class ExpectationCategory(str, Enum):
14-
"""Categories for expectations."""
15-
16-
COLUMN_EXPECTATIONS = "Column Expectations"
17-
COLUMN_AGGREGATION_EXPECTATIONS = "Column Aggregation Expectations"
18-
DATAFRAME_AGGREGATION_EXPECTATIONS = "DataFrame Aggregation Expectations"
19-
20-
21-
class ExpectationSubcategory(str, Enum):
22-
"""Subcategory of expectations."""
23-
24-
ANY_VALUE = "Any Value"
25-
NUMERICAL = "Numerical"
26-
STRING = "String"
27-
UNIQUE = "Unique"
28-
29-
30-
class ExpectationMetadata(BaseModel):
31-
"""Metadata for a registered expectation."""
32-
33-
suite_method_name: str = Field(
34-
..., description="Method name in ExpectationsSuite (e.g., 'expect_value_greater_than')"
35-
)
36-
pydoc: str = Field(..., description="Human-readable description of the expectation")
37-
category: ExpectationCategory = Field(..., description="Category (e.g., 'Column Expectations')")
38-
subcategory: ExpectationSubcategory = Field(
39-
..., description="Subcategory (e.g., 'Numerical', 'String')"
40-
)
41-
params_doc: Dict[str, str] = Field(..., description="Documentation for each parameter")
42-
params: list = Field(default_factory=list, description="List of required parameter names")
43-
param_types: Dict[str, Any] = Field(
44-
default_factory=dict, description="Type hints for parameters"
45-
)
46-
factory_func_name: str = Field(..., description="Name of the factory function")
47-
expectation_name: str = Field(..., description="Name of the expectation class")
48-
49-
model_config = ConfigDict(frozen=True) # Make model immutable
50-
51-
5215
class DataFrameExpectationRegistry:
5316
"""Registry for dataframe expectations."""
5417

0 commit comments

Comments
 (0)