truthound-dashboard 1.2.1__py3-none-any.whl → 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. truthound_dashboard/api/deps.py +28 -0
  2. truthound_dashboard/api/drift.py +1 -0
  3. truthound_dashboard/api/mask.py +164 -0
  4. truthound_dashboard/api/profile.py +11 -3
  5. truthound_dashboard/api/router.py +22 -0
  6. truthound_dashboard/api/scan.py +168 -0
  7. truthound_dashboard/api/schemas.py +13 -4
  8. truthound_dashboard/api/validations.py +33 -1
  9. truthound_dashboard/api/validators.py +85 -0
  10. truthound_dashboard/core/__init__.py +8 -0
  11. truthound_dashboard/core/phase5/activity.py +1 -1
  12. truthound_dashboard/core/services.py +457 -7
  13. truthound_dashboard/core/truthound_adapter.py +441 -26
  14. truthound_dashboard/db/__init__.py +6 -0
  15. truthound_dashboard/db/models.py +250 -1
  16. truthound_dashboard/schemas/__init__.py +52 -1
  17. truthound_dashboard/schemas/collaboration.py +1 -1
  18. truthound_dashboard/schemas/drift.py +118 -3
  19. truthound_dashboard/schemas/mask.py +209 -0
  20. truthound_dashboard/schemas/profile.py +45 -2
  21. truthound_dashboard/schemas/scan.py +312 -0
  22. truthound_dashboard/schemas/schema.py +30 -2
  23. truthound_dashboard/schemas/validation.py +60 -3
  24. truthound_dashboard/schemas/validators/__init__.py +59 -0
  25. truthound_dashboard/schemas/validators/aggregate_validators.py +238 -0
  26. truthound_dashboard/schemas/validators/anomaly_validators.py +723 -0
  27. truthound_dashboard/schemas/validators/base.py +263 -0
  28. truthound_dashboard/schemas/validators/completeness_validators.py +269 -0
  29. truthound_dashboard/schemas/validators/cross_table_validators.py +375 -0
  30. truthound_dashboard/schemas/validators/datetime_validators.py +253 -0
  31. truthound_dashboard/schemas/validators/distribution_validators.py +422 -0
  32. truthound_dashboard/schemas/validators/drift_validators.py +615 -0
  33. truthound_dashboard/schemas/validators/geospatial_validators.py +486 -0
  34. truthound_dashboard/schemas/validators/multi_column_validators.py +706 -0
  35. truthound_dashboard/schemas/validators/privacy_validators.py +531 -0
  36. truthound_dashboard/schemas/validators/query_validators.py +510 -0
  37. truthound_dashboard/schemas/validators/registry.py +318 -0
  38. truthound_dashboard/schemas/validators/schema_validators.py +408 -0
  39. truthound_dashboard/schemas/validators/string_validators.py +396 -0
  40. truthound_dashboard/schemas/validators/table_validators.py +412 -0
  41. truthound_dashboard/schemas/validators/uniqueness_validators.py +355 -0
  42. truthound_dashboard/schemas/validators.py +59 -0
  43. truthound_dashboard/static/assets/{index-BqXVFyqj.js → index-BCA8H1hO.js} +95 -95
  44. truthound_dashboard/static/assets/index-BNsSQ2fN.css +1 -0
  45. truthound_dashboard/static/assets/unmerged_dictionaries-CsJWCRx9.js +1 -0
  46. truthound_dashboard/static/index.html +2 -2
  47. {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.0.dist-info}/METADATA +46 -11
  48. {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.0.dist-info}/RECORD +51 -27
  49. truthound_dashboard/static/assets/index-o8qHVDte.css +0 -1
  50. truthound_dashboard/static/assets/unmerged_dictionaries-n_T3wZTf.js +0 -1
  51. {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.0.dist-info}/WHEEL +0 -0
  52. {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.0.dist-info}/entry_points.txt +0 -0
  53. {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -11,6 +11,7 @@ from typing import Any, Literal
11
11
  from pydantic import Field
12
12
 
13
13
  from .base import BaseSchema, IDMixin, ListResponseWrapper
14
+ from .validators import ValidatorConfig
14
15
 
15
16
  # Validation status types
16
17
  ValidationStatus = Literal["pending", "running", "success", "failed", "error"]
@@ -42,13 +43,32 @@ class ValidationIssue(BaseSchema):
42
43
 
43
44
 
44
45
  class ValidationRunRequest(BaseSchema):
45
- """Request to run validation on a source."""
46
+ """Request to run validation on a source.
46
47
 
48
+ This schema maps to truthound's th.check() parameters for maximum flexibility.
49
+ All optional parameters default to None/False to use truthound's defaults.
50
+
51
+ Supports two modes:
52
+ 1. Simple mode: Use `validators` list with validator names (backward compatible)
53
+ 2. Advanced mode: Use `validator_configs` for per-validator parameter configuration
54
+ """
55
+
56
+ # Core validation options - Simple mode (backward compatible)
47
57
  validators: list[str] | None = Field(
48
58
  default=None,
49
- description="Specific validators to run. If None, all validators are used.",
50
- examples=[["null", "duplicate", "schema"]],
59
+ description="Specific validators to run by name. If None, all validators are used.",
60
+ examples=[["Null", "Duplicate", "ColumnExists"]],
61
+ )
62
+
63
+ # Advanced mode - Per-validator configuration
64
+ validator_configs: list[ValidatorConfig] | None = Field(
65
+ default=None,
66
+ description=(
67
+ "Advanced: Configure individual validators with specific parameters. "
68
+ "Takes precedence over 'validators' list if provided."
69
+ ),
51
70
  )
71
+
52
72
  schema_path: str | None = Field(
53
73
  default=None,
54
74
  description="Path to schema YAML file for schema validation",
@@ -58,6 +78,43 @@ class ValidationRunRequest(BaseSchema):
58
78
  description="Auto-learn and cache schema for validation",
59
79
  )
60
80
 
81
+ # Column filtering
82
+ columns: list[str] | None = Field(
83
+ default=None,
84
+ description="Columns to validate. If None, all columns are validated.",
85
+ examples=[["user_id", "email", "created_at"]],
86
+ )
87
+
88
+ # Severity filtering
89
+ min_severity: Literal["low", "medium", "high", "critical"] | None = Field(
90
+ default=None,
91
+ description="Minimum severity level to report. Issues below this level are ignored.",
92
+ examples=["medium"],
93
+ )
94
+
95
+ # Execution behavior
96
+ strict: bool = Field(
97
+ default=False,
98
+ description="If True, raise exception on validation failures instead of returning results.",
99
+ )
100
+
101
+ # Performance options
102
+ parallel: bool = Field(
103
+ default=False,
104
+ description="If True, uses DAG-based parallel execution for validators.",
105
+ )
106
+ max_workers: int | None = Field(
107
+ default=None,
108
+ ge=1,
109
+ le=32,
110
+ description="Maximum number of worker threads for parallel execution. Only used when parallel=True.",
111
+ examples=[4, 8],
112
+ )
113
+ pushdown: bool | None = Field(
114
+ default=None,
115
+ description="Enable query pushdown optimization for SQL data sources. None uses auto-detection.",
116
+ )
117
+
61
118
 
62
119
  class ValidationSummary(BaseSchema):
63
120
  """Summary statistics for a validation run."""
@@ -0,0 +1,59 @@
1
+ """Validator registry module.
2
+
3
+ This module provides a modular, extensible validator registry system.
4
+ Each validator category is defined in a separate module for maintainability.
5
+
6
+ Usage:
7
+ from truthound_dashboard.schemas.validators import (
8
+ VALIDATOR_REGISTRY,
9
+ get_validator_by_name,
10
+ get_validators_by_category,
11
+ search_validators,
12
+ ValidatorDefinition,
13
+ ValidatorConfig,
14
+ ValidatorCategory,
15
+ )
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from .base import (
21
+ ParameterDefinition,
22
+ ParameterType,
23
+ ValidatorCategory,
24
+ ValidatorConfig,
25
+ ValidatorConfigList,
26
+ ValidatorDefinition,
27
+ configs_to_truthound_format,
28
+ has_custom_params,
29
+ merge_severity_overrides,
30
+ )
31
+ from .registry import (
32
+ VALIDATOR_REGISTRY,
33
+ get_validator_by_name,
34
+ get_validators_by_category,
35
+ search_validators,
36
+ get_category_info,
37
+ CATEGORY_INFO,
38
+ )
39
+
40
+ __all__ = [
41
+ # Base types
42
+ "ParameterDefinition",
43
+ "ParameterType",
44
+ "ValidatorCategory",
45
+ "ValidatorConfig",
46
+ "ValidatorConfigList",
47
+ "ValidatorDefinition",
48
+ # Utility functions
49
+ "configs_to_truthound_format",
50
+ "has_custom_params",
51
+ "merge_severity_overrides",
52
+ # Registry
53
+ "VALIDATOR_REGISTRY",
54
+ "get_validator_by_name",
55
+ "get_validators_by_category",
56
+ "search_validators",
57
+ "get_category_info",
58
+ "CATEGORY_INFO",
59
+ ]
@@ -0,0 +1,238 @@
1
+ """Aggregate validators.
2
+
3
+ Validators for column-level statistical verification.
4
+ """
5
+
6
+ from .base import (
7
+ ParameterDefinition,
8
+ ParameterType,
9
+ ValidatorCategory,
10
+ ValidatorDefinition,
11
+ )
12
+
13
+ AGGREGATE_VALIDATORS: list[ValidatorDefinition] = [
14
+ ValidatorDefinition(
15
+ name="MeanBetween",
16
+ display_name="Mean Between",
17
+ category=ValidatorCategory.AGGREGATE,
18
+ description="Validates that the column mean falls within a specified range.",
19
+ parameters=[
20
+ ParameterDefinition(
21
+ name="column",
22
+ label="Column",
23
+ type=ParameterType.COLUMN,
24
+ required=True,
25
+ ),
26
+ ParameterDefinition(
27
+ name="min_value",
28
+ label="Minimum Mean",
29
+ type=ParameterType.FLOAT,
30
+ description="Minimum acceptable mean value",
31
+ ),
32
+ ParameterDefinition(
33
+ name="max_value",
34
+ label="Maximum Mean",
35
+ type=ParameterType.FLOAT,
36
+ description="Maximum acceptable mean value",
37
+ ),
38
+ ],
39
+ tags=["aggregate", "mean", "average", "statistical"],
40
+ severity_default="medium",
41
+ ),
42
+ ValidatorDefinition(
43
+ name="MedianBetween",
44
+ display_name="Median Between",
45
+ category=ValidatorCategory.AGGREGATE,
46
+ description="Validates that the column median falls within a specified range.",
47
+ parameters=[
48
+ ParameterDefinition(
49
+ name="column",
50
+ label="Column",
51
+ type=ParameterType.COLUMN,
52
+ required=True,
53
+ ),
54
+ ParameterDefinition(
55
+ name="min_value",
56
+ label="Minimum Median",
57
+ type=ParameterType.FLOAT,
58
+ description="Minimum acceptable median value",
59
+ ),
60
+ ParameterDefinition(
61
+ name="max_value",
62
+ label="Maximum Median",
63
+ type=ParameterType.FLOAT,
64
+ description="Maximum acceptable median value",
65
+ ),
66
+ ],
67
+ tags=["aggregate", "median", "statistical"],
68
+ severity_default="medium",
69
+ ),
70
+ ValidatorDefinition(
71
+ name="StdBetween",
72
+ display_name="Standard Deviation Between",
73
+ category=ValidatorCategory.AGGREGATE,
74
+ description="Validates that the column standard deviation falls within a specified range.",
75
+ parameters=[
76
+ ParameterDefinition(
77
+ name="column",
78
+ label="Column",
79
+ type=ParameterType.COLUMN,
80
+ required=True,
81
+ ),
82
+ ParameterDefinition(
83
+ name="min_value",
84
+ label="Minimum Std Dev",
85
+ type=ParameterType.FLOAT,
86
+ description="Minimum acceptable standard deviation",
87
+ min_value=0,
88
+ ),
89
+ ParameterDefinition(
90
+ name="max_value",
91
+ label="Maximum Std Dev",
92
+ type=ParameterType.FLOAT,
93
+ description="Maximum acceptable standard deviation",
94
+ min_value=0,
95
+ ),
96
+ ],
97
+ tags=["aggregate", "std", "standard_deviation", "statistical"],
98
+ severity_default="medium",
99
+ ),
100
+ ValidatorDefinition(
101
+ name="VarianceBetween",
102
+ display_name="Variance Between",
103
+ category=ValidatorCategory.AGGREGATE,
104
+ description="Validates that the column variance falls within a specified range.",
105
+ parameters=[
106
+ ParameterDefinition(
107
+ name="column",
108
+ label="Column",
109
+ type=ParameterType.COLUMN,
110
+ required=True,
111
+ ),
112
+ ParameterDefinition(
113
+ name="min_value",
114
+ label="Minimum Variance",
115
+ type=ParameterType.FLOAT,
116
+ description="Minimum acceptable variance",
117
+ min_value=0,
118
+ ),
119
+ ParameterDefinition(
120
+ name="max_value",
121
+ label="Maximum Variance",
122
+ type=ParameterType.FLOAT,
123
+ description="Maximum acceptable variance",
124
+ min_value=0,
125
+ ),
126
+ ],
127
+ tags=["aggregate", "variance", "statistical"],
128
+ severity_default="medium",
129
+ ),
130
+ ValidatorDefinition(
131
+ name="SumBetween",
132
+ display_name="Sum Between",
133
+ category=ValidatorCategory.AGGREGATE,
134
+ description="Validates that the column sum falls within a specified range.",
135
+ parameters=[
136
+ ParameterDefinition(
137
+ name="column",
138
+ label="Column",
139
+ type=ParameterType.COLUMN,
140
+ required=True,
141
+ ),
142
+ ParameterDefinition(
143
+ name="min_value",
144
+ label="Minimum Sum",
145
+ type=ParameterType.FLOAT,
146
+ description="Minimum acceptable sum value",
147
+ ),
148
+ ParameterDefinition(
149
+ name="max_value",
150
+ label="Maximum Sum",
151
+ type=ParameterType.FLOAT,
152
+ description="Maximum acceptable sum value",
153
+ ),
154
+ ],
155
+ tags=["aggregate", "sum", "total", "statistical"],
156
+ severity_default="medium",
157
+ ),
158
+ ValidatorDefinition(
159
+ name="MinBetween",
160
+ display_name="Min Value Between",
161
+ category=ValidatorCategory.AGGREGATE,
162
+ description="Validates that the column minimum value falls within a specified range.",
163
+ parameters=[
164
+ ParameterDefinition(
165
+ name="column",
166
+ label="Column",
167
+ type=ParameterType.COLUMN,
168
+ required=True,
169
+ ),
170
+ ParameterDefinition(
171
+ name="min_value",
172
+ label="Minimum of Min",
173
+ type=ParameterType.FLOAT,
174
+ description="Lower bound for the column minimum",
175
+ ),
176
+ ParameterDefinition(
177
+ name="max_value",
178
+ label="Maximum of Min",
179
+ type=ParameterType.FLOAT,
180
+ description="Upper bound for the column minimum",
181
+ ),
182
+ ],
183
+ tags=["aggregate", "min", "minimum", "bounds"],
184
+ severity_default="medium",
185
+ ),
186
+ ValidatorDefinition(
187
+ name="MaxBetween",
188
+ display_name="Max Value Between",
189
+ category=ValidatorCategory.AGGREGATE,
190
+ description="Validates that the column maximum value falls within a specified range.",
191
+ parameters=[
192
+ ParameterDefinition(
193
+ name="column",
194
+ label="Column",
195
+ type=ParameterType.COLUMN,
196
+ required=True,
197
+ ),
198
+ ParameterDefinition(
199
+ name="min_value",
200
+ label="Minimum of Max",
201
+ type=ParameterType.FLOAT,
202
+ description="Lower bound for the column maximum",
203
+ ),
204
+ ParameterDefinition(
205
+ name="max_value",
206
+ label="Maximum of Max",
207
+ type=ParameterType.FLOAT,
208
+ description="Upper bound for the column maximum",
209
+ ),
210
+ ],
211
+ tags=["aggregate", "max", "maximum", "bounds"],
212
+ severity_default="medium",
213
+ ),
214
+ ValidatorDefinition(
215
+ name="CountBetween",
216
+ display_name="Count Between",
217
+ category=ValidatorCategory.AGGREGATE,
218
+ description="Validates that the row count falls within a specified range.",
219
+ parameters=[
220
+ ParameterDefinition(
221
+ name="min_count",
222
+ label="Minimum Count",
223
+ type=ParameterType.INTEGER,
224
+ description="Minimum acceptable row count",
225
+ min_value=0,
226
+ ),
227
+ ParameterDefinition(
228
+ name="max_count",
229
+ label="Maximum Count",
230
+ type=ParameterType.INTEGER,
231
+ description="Maximum acceptable row count",
232
+ min_value=0,
233
+ ),
234
+ ],
235
+ tags=["aggregate", "count", "rows"],
236
+ severity_default="medium",
237
+ ),
238
+ ]