truthound-dashboard 1.2.1__py3-none-any.whl → 1.3.1__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.
- truthound_dashboard/api/deps.py +28 -0
- truthound_dashboard/api/drift.py +1 -0
- truthound_dashboard/api/mask.py +164 -0
- truthound_dashboard/api/profile.py +11 -3
- truthound_dashboard/api/router.py +22 -0
- truthound_dashboard/api/scan.py +168 -0
- truthound_dashboard/api/schemas.py +13 -4
- truthound_dashboard/api/validations.py +33 -1
- truthound_dashboard/api/validators.py +85 -0
- truthound_dashboard/core/__init__.py +8 -0
- truthound_dashboard/core/phase5/activity.py +1 -1
- truthound_dashboard/core/services.py +457 -7
- truthound_dashboard/core/truthound_adapter.py +441 -26
- truthound_dashboard/db/__init__.py +6 -0
- truthound_dashboard/db/models.py +250 -1
- truthound_dashboard/schemas/__init__.py +52 -1
- truthound_dashboard/schemas/collaboration.py +1 -1
- truthound_dashboard/schemas/drift.py +118 -3
- truthound_dashboard/schemas/mask.py +209 -0
- truthound_dashboard/schemas/profile.py +45 -2
- truthound_dashboard/schemas/scan.py +312 -0
- truthound_dashboard/schemas/schema.py +30 -2
- truthound_dashboard/schemas/validation.py +60 -3
- truthound_dashboard/schemas/validators/__init__.py +59 -0
- truthound_dashboard/schemas/validators/aggregate_validators.py +238 -0
- truthound_dashboard/schemas/validators/anomaly_validators.py +723 -0
- truthound_dashboard/schemas/validators/base.py +263 -0
- truthound_dashboard/schemas/validators/completeness_validators.py +269 -0
- truthound_dashboard/schemas/validators/cross_table_validators.py +375 -0
- truthound_dashboard/schemas/validators/datetime_validators.py +253 -0
- truthound_dashboard/schemas/validators/distribution_validators.py +422 -0
- truthound_dashboard/schemas/validators/drift_validators.py +615 -0
- truthound_dashboard/schemas/validators/geospatial_validators.py +486 -0
- truthound_dashboard/schemas/validators/multi_column_validators.py +706 -0
- truthound_dashboard/schemas/validators/privacy_validators.py +531 -0
- truthound_dashboard/schemas/validators/query_validators.py +510 -0
- truthound_dashboard/schemas/validators/registry.py +318 -0
- truthound_dashboard/schemas/validators/schema_validators.py +408 -0
- truthound_dashboard/schemas/validators/string_validators.py +396 -0
- truthound_dashboard/schemas/validators/table_validators.py +412 -0
- truthound_dashboard/schemas/validators/uniqueness_validators.py +355 -0
- truthound_dashboard/schemas/validators.py +59 -0
- truthound_dashboard/static/assets/index-BZG20KuF.js +586 -0
- truthound_dashboard/static/assets/index-D_HyZ3pb.css +1 -0
- truthound_dashboard/static/assets/unmerged_dictionaries-CtpqQBm0.js +1 -0
- truthound_dashboard/static/index.html +2 -2
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/METADATA +50 -11
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/RECORD +51 -27
- truthound_dashboard/static/assets/index-BqXVFyqj.js +0 -574
- truthound_dashboard/static/assets/index-o8qHVDte.css +0 -1
- truthound_dashboard/static/assets/unmerged_dictionaries-n_T3wZTf.js +0 -1
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/WHEEL +0 -0
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/entry_points.txt +0 -0
- {truthound_dashboard-1.2.1.dist-info → truthound_dashboard-1.3.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
"""Multi-column validators.
|
|
2
|
+
|
|
3
|
+
Validators for cross-column relationships, calculations, and constraints.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .base import (
|
|
7
|
+
ParameterDefinition,
|
|
8
|
+
ParameterType,
|
|
9
|
+
ValidatorCategory,
|
|
10
|
+
ValidatorDefinition,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
MULTI_COLUMN_VALIDATORS: list[ValidatorDefinition] = [
|
|
14
|
+
ValidatorDefinition(
|
|
15
|
+
name="ColumnComparison",
|
|
16
|
+
display_name="Column Comparison",
|
|
17
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
18
|
+
description="Compares values between two columns using an operator.",
|
|
19
|
+
parameters=[
|
|
20
|
+
ParameterDefinition(
|
|
21
|
+
name="column_a",
|
|
22
|
+
label="First Column",
|
|
23
|
+
type=ParameterType.COLUMN,
|
|
24
|
+
required=True,
|
|
25
|
+
),
|
|
26
|
+
ParameterDefinition(
|
|
27
|
+
name="column_b",
|
|
28
|
+
label="Second Column",
|
|
29
|
+
type=ParameterType.COLUMN,
|
|
30
|
+
required=True,
|
|
31
|
+
),
|
|
32
|
+
ParameterDefinition(
|
|
33
|
+
name="operator",
|
|
34
|
+
label="Operator",
|
|
35
|
+
type=ParameterType.SELECT,
|
|
36
|
+
required=True,
|
|
37
|
+
options=[
|
|
38
|
+
{"value": "eq", "label": "Equal (=)"},
|
|
39
|
+
{"value": "ne", "label": "Not Equal (!=)"},
|
|
40
|
+
{"value": "gt", "label": "Greater Than (>)"},
|
|
41
|
+
{"value": "gte", "label": "Greater Than or Equal (>=)"},
|
|
42
|
+
{"value": "lt", "label": "Less Than (<)"},
|
|
43
|
+
{"value": "lte", "label": "Less Than or Equal (<=)"},
|
|
44
|
+
],
|
|
45
|
+
),
|
|
46
|
+
ParameterDefinition(
|
|
47
|
+
name="mostly",
|
|
48
|
+
label="Mostly (Threshold)",
|
|
49
|
+
type=ParameterType.FLOAT,
|
|
50
|
+
description="Acceptable pass ratio (0.0-1.0)",
|
|
51
|
+
min_value=0,
|
|
52
|
+
max_value=1,
|
|
53
|
+
),
|
|
54
|
+
],
|
|
55
|
+
tags=["multi_column", "comparison", "relationship"],
|
|
56
|
+
severity_default="medium",
|
|
57
|
+
),
|
|
58
|
+
ValidatorDefinition(
|
|
59
|
+
name="ColumnArithmetic",
|
|
60
|
+
display_name="Column Arithmetic",
|
|
61
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
62
|
+
description="Validates arithmetic relationships between columns (A op B = C).",
|
|
63
|
+
parameters=[
|
|
64
|
+
ParameterDefinition(
|
|
65
|
+
name="column_a",
|
|
66
|
+
label="First Operand Column",
|
|
67
|
+
type=ParameterType.COLUMN,
|
|
68
|
+
required=True,
|
|
69
|
+
),
|
|
70
|
+
ParameterDefinition(
|
|
71
|
+
name="column_b",
|
|
72
|
+
label="Second Operand Column",
|
|
73
|
+
type=ParameterType.COLUMN,
|
|
74
|
+
required=True,
|
|
75
|
+
),
|
|
76
|
+
ParameterDefinition(
|
|
77
|
+
name="result_column",
|
|
78
|
+
label="Result Column",
|
|
79
|
+
type=ParameterType.COLUMN,
|
|
80
|
+
description="Column that should contain the result",
|
|
81
|
+
required=True,
|
|
82
|
+
),
|
|
83
|
+
ParameterDefinition(
|
|
84
|
+
name="operation",
|
|
85
|
+
label="Operation",
|
|
86
|
+
type=ParameterType.SELECT,
|
|
87
|
+
required=True,
|
|
88
|
+
options=[
|
|
89
|
+
{"value": "add", "label": "Addition (A + B)"},
|
|
90
|
+
{"value": "subtract", "label": "Subtraction (A - B)"},
|
|
91
|
+
{"value": "multiply", "label": "Multiplication (A * B)"},
|
|
92
|
+
{"value": "divide", "label": "Division (A / B)"},
|
|
93
|
+
{"value": "modulo", "label": "Modulo (A % B)"},
|
|
94
|
+
],
|
|
95
|
+
),
|
|
96
|
+
ParameterDefinition(
|
|
97
|
+
name="tolerance",
|
|
98
|
+
label="Tolerance",
|
|
99
|
+
type=ParameterType.FLOAT,
|
|
100
|
+
description="Acceptable tolerance for floating point comparison",
|
|
101
|
+
default=0.0001,
|
|
102
|
+
min_value=0,
|
|
103
|
+
),
|
|
104
|
+
],
|
|
105
|
+
tags=["multi_column", "arithmetic", "calculation"],
|
|
106
|
+
severity_default="medium",
|
|
107
|
+
),
|
|
108
|
+
ValidatorDefinition(
|
|
109
|
+
name="ColumnSum",
|
|
110
|
+
display_name="Column Sum",
|
|
111
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
112
|
+
description="Validates that sum of columns equals a target column.",
|
|
113
|
+
parameters=[
|
|
114
|
+
ParameterDefinition(
|
|
115
|
+
name="columns",
|
|
116
|
+
label="Source Columns",
|
|
117
|
+
type=ParameterType.COLUMN_LIST,
|
|
118
|
+
description="Columns to sum together",
|
|
119
|
+
required=True,
|
|
120
|
+
),
|
|
121
|
+
ParameterDefinition(
|
|
122
|
+
name="target_column",
|
|
123
|
+
label="Target Column",
|
|
124
|
+
type=ParameterType.COLUMN,
|
|
125
|
+
description="Column that should equal the sum",
|
|
126
|
+
required=True,
|
|
127
|
+
),
|
|
128
|
+
ParameterDefinition(
|
|
129
|
+
name="tolerance",
|
|
130
|
+
label="Tolerance",
|
|
131
|
+
type=ParameterType.FLOAT,
|
|
132
|
+
default=0.0001,
|
|
133
|
+
min_value=0,
|
|
134
|
+
),
|
|
135
|
+
],
|
|
136
|
+
tags=["multi_column", "sum", "calculation"],
|
|
137
|
+
severity_default="medium",
|
|
138
|
+
),
|
|
139
|
+
ValidatorDefinition(
|
|
140
|
+
name="ColumnRatio",
|
|
141
|
+
display_name="Column Ratio",
|
|
142
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
143
|
+
description="Validates that ratio of two columns meets expectations.",
|
|
144
|
+
parameters=[
|
|
145
|
+
ParameterDefinition(
|
|
146
|
+
name="numerator_column",
|
|
147
|
+
label="Numerator Column",
|
|
148
|
+
type=ParameterType.COLUMN,
|
|
149
|
+
required=True,
|
|
150
|
+
),
|
|
151
|
+
ParameterDefinition(
|
|
152
|
+
name="denominator_column",
|
|
153
|
+
label="Denominator Column",
|
|
154
|
+
type=ParameterType.COLUMN,
|
|
155
|
+
required=True,
|
|
156
|
+
),
|
|
157
|
+
ParameterDefinition(
|
|
158
|
+
name="expected_ratio",
|
|
159
|
+
label="Expected Ratio",
|
|
160
|
+
type=ParameterType.FLOAT,
|
|
161
|
+
description="Expected ratio value",
|
|
162
|
+
),
|
|
163
|
+
ParameterDefinition(
|
|
164
|
+
name="min_ratio",
|
|
165
|
+
label="Minimum Ratio",
|
|
166
|
+
type=ParameterType.FLOAT,
|
|
167
|
+
description="Minimum acceptable ratio",
|
|
168
|
+
),
|
|
169
|
+
ParameterDefinition(
|
|
170
|
+
name="max_ratio",
|
|
171
|
+
label="Maximum Ratio",
|
|
172
|
+
type=ParameterType.FLOAT,
|
|
173
|
+
description="Maximum acceptable ratio",
|
|
174
|
+
),
|
|
175
|
+
ParameterDefinition(
|
|
176
|
+
name="tolerance",
|
|
177
|
+
label="Tolerance",
|
|
178
|
+
type=ParameterType.FLOAT,
|
|
179
|
+
default=0.01,
|
|
180
|
+
min_value=0,
|
|
181
|
+
),
|
|
182
|
+
],
|
|
183
|
+
tags=["multi_column", "ratio", "calculation"],
|
|
184
|
+
severity_default="medium",
|
|
185
|
+
),
|
|
186
|
+
ValidatorDefinition(
|
|
187
|
+
name="ColumnCorrelation",
|
|
188
|
+
display_name="Column Correlation",
|
|
189
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
190
|
+
description="Validates Pearson correlation between two numeric columns.",
|
|
191
|
+
parameters=[
|
|
192
|
+
ParameterDefinition(
|
|
193
|
+
name="column_a",
|
|
194
|
+
label="First Column",
|
|
195
|
+
type=ParameterType.COLUMN,
|
|
196
|
+
required=True,
|
|
197
|
+
),
|
|
198
|
+
ParameterDefinition(
|
|
199
|
+
name="column_b",
|
|
200
|
+
label="Second Column",
|
|
201
|
+
type=ParameterType.COLUMN,
|
|
202
|
+
required=True,
|
|
203
|
+
),
|
|
204
|
+
ParameterDefinition(
|
|
205
|
+
name="min_correlation",
|
|
206
|
+
label="Minimum Correlation",
|
|
207
|
+
type=ParameterType.FLOAT,
|
|
208
|
+
description="Minimum expected correlation coefficient",
|
|
209
|
+
min_value=-1,
|
|
210
|
+
max_value=1,
|
|
211
|
+
),
|
|
212
|
+
ParameterDefinition(
|
|
213
|
+
name="max_correlation",
|
|
214
|
+
label="Maximum Correlation",
|
|
215
|
+
type=ParameterType.FLOAT,
|
|
216
|
+
description="Maximum expected correlation coefficient",
|
|
217
|
+
min_value=-1,
|
|
218
|
+
max_value=1,
|
|
219
|
+
),
|
|
220
|
+
],
|
|
221
|
+
tags=["multi_column", "correlation", "statistics"],
|
|
222
|
+
severity_default="medium",
|
|
223
|
+
),
|
|
224
|
+
ValidatorDefinition(
|
|
225
|
+
name="ColumnDependency",
|
|
226
|
+
display_name="Column Dependency",
|
|
227
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
228
|
+
description="Validates functional dependency: if A then B (determinant -> dependent).",
|
|
229
|
+
parameters=[
|
|
230
|
+
ParameterDefinition(
|
|
231
|
+
name="determinant_column",
|
|
232
|
+
label="Determinant Column",
|
|
233
|
+
type=ParameterType.COLUMN,
|
|
234
|
+
description="Column that determines the value of another",
|
|
235
|
+
required=True,
|
|
236
|
+
),
|
|
237
|
+
ParameterDefinition(
|
|
238
|
+
name="dependent_column",
|
|
239
|
+
label="Dependent Column",
|
|
240
|
+
type=ParameterType.COLUMN,
|
|
241
|
+
description="Column whose value is determined by the determinant",
|
|
242
|
+
required=True,
|
|
243
|
+
),
|
|
244
|
+
ParameterDefinition(
|
|
245
|
+
name="allow_null",
|
|
246
|
+
label="Allow Null",
|
|
247
|
+
type=ParameterType.BOOLEAN,
|
|
248
|
+
description="Allow null values in dependent column",
|
|
249
|
+
default=True,
|
|
250
|
+
),
|
|
251
|
+
],
|
|
252
|
+
tags=["multi_column", "dependency", "functional"],
|
|
253
|
+
severity_default="high",
|
|
254
|
+
),
|
|
255
|
+
ValidatorDefinition(
|
|
256
|
+
name="Conditional",
|
|
257
|
+
display_name="Conditional",
|
|
258
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
259
|
+
description="Validates conditional logic: if condition then expectation.",
|
|
260
|
+
parameters=[
|
|
261
|
+
ParameterDefinition(
|
|
262
|
+
name="when_column",
|
|
263
|
+
label="Condition Column",
|
|
264
|
+
type=ParameterType.COLUMN,
|
|
265
|
+
description="Column to check condition against",
|
|
266
|
+
required=True,
|
|
267
|
+
),
|
|
268
|
+
ParameterDefinition(
|
|
269
|
+
name="when_value",
|
|
270
|
+
label="Condition Value",
|
|
271
|
+
type=ParameterType.STRING,
|
|
272
|
+
description="Value that triggers the expectation",
|
|
273
|
+
required=True,
|
|
274
|
+
),
|
|
275
|
+
ParameterDefinition(
|
|
276
|
+
name="then_column",
|
|
277
|
+
label="Then Column",
|
|
278
|
+
type=ParameterType.COLUMN,
|
|
279
|
+
description="Column to validate when condition is met",
|
|
280
|
+
required=True,
|
|
281
|
+
),
|
|
282
|
+
ParameterDefinition(
|
|
283
|
+
name="then_operator",
|
|
284
|
+
label="Then Operator",
|
|
285
|
+
type=ParameterType.SELECT,
|
|
286
|
+
required=True,
|
|
287
|
+
options=[
|
|
288
|
+
{"value": "not_null", "label": "Not Null"},
|
|
289
|
+
{"value": "null", "label": "Null"},
|
|
290
|
+
{"value": "eq", "label": "Equals"},
|
|
291
|
+
{"value": "ne", "label": "Not Equals"},
|
|
292
|
+
{"value": "gt", "label": "Greater Than"},
|
|
293
|
+
{"value": "lt", "label": "Less Than"},
|
|
294
|
+
{"value": "in_set", "label": "In Set"},
|
|
295
|
+
],
|
|
296
|
+
),
|
|
297
|
+
ParameterDefinition(
|
|
298
|
+
name="then_value",
|
|
299
|
+
label="Then Value",
|
|
300
|
+
type=ParameterType.STRING,
|
|
301
|
+
description="Expected value (for eq/ne/gt/lt operators)",
|
|
302
|
+
depends_on="then_operator",
|
|
303
|
+
depends_value="eq",
|
|
304
|
+
),
|
|
305
|
+
],
|
|
306
|
+
tags=["multi_column", "conditional", "business_rule"],
|
|
307
|
+
severity_default="high",
|
|
308
|
+
),
|
|
309
|
+
ValidatorDefinition(
|
|
310
|
+
name="ColumnChainComparison",
|
|
311
|
+
display_name="Column Chain Comparison",
|
|
312
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
313
|
+
description="Validates ordered relationships across multiple columns (A < B < C).",
|
|
314
|
+
parameters=[
|
|
315
|
+
ParameterDefinition(
|
|
316
|
+
name="columns",
|
|
317
|
+
label="Columns (in order)",
|
|
318
|
+
type=ParameterType.COLUMN_LIST,
|
|
319
|
+
description="Columns to compare in sequence",
|
|
320
|
+
required=True,
|
|
321
|
+
),
|
|
322
|
+
ParameterDefinition(
|
|
323
|
+
name="operator",
|
|
324
|
+
label="Operator",
|
|
325
|
+
type=ParameterType.SELECT,
|
|
326
|
+
required=True,
|
|
327
|
+
options=[
|
|
328
|
+
{"value": "lt", "label": "Less Than (<)"},
|
|
329
|
+
{"value": "lte", "label": "Less Than or Equal (<=)"},
|
|
330
|
+
{"value": "gt", "label": "Greater Than (>)"},
|
|
331
|
+
{"value": "gte", "label": "Greater Than or Equal (>=)"},
|
|
332
|
+
],
|
|
333
|
+
),
|
|
334
|
+
ParameterDefinition(
|
|
335
|
+
name="strict",
|
|
336
|
+
label="Strict",
|
|
337
|
+
type=ParameterType.BOOLEAN,
|
|
338
|
+
description="If true, use strict comparison (< instead of <=)",
|
|
339
|
+
default=True,
|
|
340
|
+
),
|
|
341
|
+
],
|
|
342
|
+
tags=["multi_column", "chain", "ordering"],
|
|
343
|
+
severity_default="medium",
|
|
344
|
+
),
|
|
345
|
+
ValidatorDefinition(
|
|
346
|
+
name="ColumnConsistency",
|
|
347
|
+
display_name="Column Consistency",
|
|
348
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
349
|
+
description="Validates that column values are consistent within groupings.",
|
|
350
|
+
parameters=[
|
|
351
|
+
ParameterDefinition(
|
|
352
|
+
name="columns",
|
|
353
|
+
label="Columns to Check",
|
|
354
|
+
type=ParameterType.COLUMN_LIST,
|
|
355
|
+
description="Columns that should be consistent",
|
|
356
|
+
required=True,
|
|
357
|
+
),
|
|
358
|
+
ParameterDefinition(
|
|
359
|
+
name="group_by",
|
|
360
|
+
label="Group By Columns",
|
|
361
|
+
type=ParameterType.COLUMN_LIST,
|
|
362
|
+
description="Columns to group by for consistency check",
|
|
363
|
+
required=True,
|
|
364
|
+
),
|
|
365
|
+
],
|
|
366
|
+
tags=["multi_column", "consistency", "grouping"],
|
|
367
|
+
severity_default="medium",
|
|
368
|
+
),
|
|
369
|
+
ValidatorDefinition(
|
|
370
|
+
name="MutualExclusivity",
|
|
371
|
+
display_name="Mutual Exclusivity",
|
|
372
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
373
|
+
description="Ensures at most one column in a group has a non-null value.",
|
|
374
|
+
parameters=[
|
|
375
|
+
ParameterDefinition(
|
|
376
|
+
name="columns",
|
|
377
|
+
label="Columns",
|
|
378
|
+
type=ParameterType.COLUMN_LIST,
|
|
379
|
+
description="Columns that are mutually exclusive",
|
|
380
|
+
required=True,
|
|
381
|
+
),
|
|
382
|
+
ParameterDefinition(
|
|
383
|
+
name="allow_all_null",
|
|
384
|
+
label="Allow All Null",
|
|
385
|
+
type=ParameterType.BOOLEAN,
|
|
386
|
+
description="Allow all columns to be null",
|
|
387
|
+
default=True,
|
|
388
|
+
),
|
|
389
|
+
],
|
|
390
|
+
tags=["multi_column", "mutex", "exclusive"],
|
|
391
|
+
severity_default="high",
|
|
392
|
+
),
|
|
393
|
+
ValidatorDefinition(
|
|
394
|
+
name="ColumnCoexistence",
|
|
395
|
+
display_name="Column Coexistence",
|
|
396
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
397
|
+
description="Ensures columns are either all null or all non-null together.",
|
|
398
|
+
parameters=[
|
|
399
|
+
ParameterDefinition(
|
|
400
|
+
name="columns",
|
|
401
|
+
label="Columns",
|
|
402
|
+
type=ParameterType.COLUMN_LIST,
|
|
403
|
+
description="Columns that must coexist",
|
|
404
|
+
required=True,
|
|
405
|
+
),
|
|
406
|
+
],
|
|
407
|
+
tags=["multi_column", "coexistence", "group"],
|
|
408
|
+
severity_default="medium",
|
|
409
|
+
),
|
|
410
|
+
ValidatorDefinition(
|
|
411
|
+
name="ColumnImplication",
|
|
412
|
+
display_name="Column Implication",
|
|
413
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
414
|
+
description="Validates implication logic: if A then B (antecedent -> consequent).",
|
|
415
|
+
parameters=[
|
|
416
|
+
ParameterDefinition(
|
|
417
|
+
name="antecedent_column",
|
|
418
|
+
label="If Column (Antecedent)",
|
|
419
|
+
type=ParameterType.COLUMN,
|
|
420
|
+
required=True,
|
|
421
|
+
),
|
|
422
|
+
ParameterDefinition(
|
|
423
|
+
name="antecedent_condition",
|
|
424
|
+
label="If Condition",
|
|
425
|
+
type=ParameterType.EXPRESSION,
|
|
426
|
+
description="Condition expression for antecedent",
|
|
427
|
+
required=True,
|
|
428
|
+
placeholder="!= null",
|
|
429
|
+
),
|
|
430
|
+
ParameterDefinition(
|
|
431
|
+
name="consequent_column",
|
|
432
|
+
label="Then Column (Consequent)",
|
|
433
|
+
type=ParameterType.COLUMN,
|
|
434
|
+
required=True,
|
|
435
|
+
),
|
|
436
|
+
ParameterDefinition(
|
|
437
|
+
name="consequent_condition",
|
|
438
|
+
label="Then Condition",
|
|
439
|
+
type=ParameterType.EXPRESSION,
|
|
440
|
+
description="Condition expression for consequent",
|
|
441
|
+
required=True,
|
|
442
|
+
placeholder="!= null",
|
|
443
|
+
),
|
|
444
|
+
],
|
|
445
|
+
tags=["multi_column", "implication", "logic"],
|
|
446
|
+
severity_default="medium",
|
|
447
|
+
),
|
|
448
|
+
ValidatorDefinition(
|
|
449
|
+
name="ColumnMax",
|
|
450
|
+
display_name="Column Maximum",
|
|
451
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
452
|
+
description="Validates that a column contains the maximum value among a set.",
|
|
453
|
+
parameters=[
|
|
454
|
+
ParameterDefinition(
|
|
455
|
+
name="max_column",
|
|
456
|
+
label="Maximum Column",
|
|
457
|
+
type=ParameterType.COLUMN,
|
|
458
|
+
description="Column that should contain the maximum",
|
|
459
|
+
required=True,
|
|
460
|
+
),
|
|
461
|
+
ParameterDefinition(
|
|
462
|
+
name="source_columns",
|
|
463
|
+
label="Source Columns",
|
|
464
|
+
type=ParameterType.COLUMN_LIST,
|
|
465
|
+
description="Columns to compare for maximum",
|
|
466
|
+
required=True,
|
|
467
|
+
),
|
|
468
|
+
],
|
|
469
|
+
tags=["multi_column", "max", "aggregate"],
|
|
470
|
+
severity_default="medium",
|
|
471
|
+
),
|
|
472
|
+
ValidatorDefinition(
|
|
473
|
+
name="ColumnMin",
|
|
474
|
+
display_name="Column Minimum",
|
|
475
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
476
|
+
description="Validates that a column contains the minimum value among a set.",
|
|
477
|
+
parameters=[
|
|
478
|
+
ParameterDefinition(
|
|
479
|
+
name="min_column",
|
|
480
|
+
label="Minimum Column",
|
|
481
|
+
type=ParameterType.COLUMN,
|
|
482
|
+
description="Column that should contain the minimum",
|
|
483
|
+
required=True,
|
|
484
|
+
),
|
|
485
|
+
ParameterDefinition(
|
|
486
|
+
name="source_columns",
|
|
487
|
+
label="Source Columns",
|
|
488
|
+
type=ParameterType.COLUMN_LIST,
|
|
489
|
+
description="Columns to compare for minimum",
|
|
490
|
+
required=True,
|
|
491
|
+
),
|
|
492
|
+
],
|
|
493
|
+
tags=["multi_column", "min", "aggregate"],
|
|
494
|
+
severity_default="medium",
|
|
495
|
+
),
|
|
496
|
+
ValidatorDefinition(
|
|
497
|
+
name="ColumnMean",
|
|
498
|
+
display_name="Column Mean",
|
|
499
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
500
|
+
description="Validates that mean of selected columns falls within a range.",
|
|
501
|
+
parameters=[
|
|
502
|
+
ParameterDefinition(
|
|
503
|
+
name="columns",
|
|
504
|
+
label="Columns",
|
|
505
|
+
type=ParameterType.COLUMN_LIST,
|
|
506
|
+
description="Columns to calculate mean across",
|
|
507
|
+
required=True,
|
|
508
|
+
),
|
|
509
|
+
ParameterDefinition(
|
|
510
|
+
name="min_value",
|
|
511
|
+
label="Minimum Mean",
|
|
512
|
+
type=ParameterType.FLOAT,
|
|
513
|
+
),
|
|
514
|
+
ParameterDefinition(
|
|
515
|
+
name="max_value",
|
|
516
|
+
label="Maximum Mean",
|
|
517
|
+
type=ParameterType.FLOAT,
|
|
518
|
+
),
|
|
519
|
+
],
|
|
520
|
+
tags=["multi_column", "mean", "aggregate"],
|
|
521
|
+
severity_default="medium",
|
|
522
|
+
),
|
|
523
|
+
ValidatorDefinition(
|
|
524
|
+
name="ColumnVariance",
|
|
525
|
+
display_name="Column Variance",
|
|
526
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
527
|
+
description="Validates variance across multiple columns.",
|
|
528
|
+
parameters=[
|
|
529
|
+
ParameterDefinition(
|
|
530
|
+
name="columns",
|
|
531
|
+
label="Columns",
|
|
532
|
+
type=ParameterType.COLUMN_LIST,
|
|
533
|
+
description="Columns to calculate variance across",
|
|
534
|
+
required=True,
|
|
535
|
+
),
|
|
536
|
+
ParameterDefinition(
|
|
537
|
+
name="min_variance",
|
|
538
|
+
label="Minimum Variance",
|
|
539
|
+
type=ParameterType.FLOAT,
|
|
540
|
+
min_value=0,
|
|
541
|
+
),
|
|
542
|
+
ParameterDefinition(
|
|
543
|
+
name="max_variance",
|
|
544
|
+
label="Maximum Variance",
|
|
545
|
+
type=ParameterType.FLOAT,
|
|
546
|
+
min_value=0,
|
|
547
|
+
),
|
|
548
|
+
],
|
|
549
|
+
tags=["multi_column", "variance", "statistics"],
|
|
550
|
+
severity_default="medium",
|
|
551
|
+
),
|
|
552
|
+
ValidatorDefinition(
|
|
553
|
+
name="ColumnCovariance",
|
|
554
|
+
display_name="Column Covariance",
|
|
555
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
556
|
+
description="Validates covariance between two columns.",
|
|
557
|
+
parameters=[
|
|
558
|
+
ParameterDefinition(
|
|
559
|
+
name="column_a",
|
|
560
|
+
label="First Column",
|
|
561
|
+
type=ParameterType.COLUMN,
|
|
562
|
+
required=True,
|
|
563
|
+
),
|
|
564
|
+
ParameterDefinition(
|
|
565
|
+
name="column_b",
|
|
566
|
+
label="Second Column",
|
|
567
|
+
type=ParameterType.COLUMN,
|
|
568
|
+
required=True,
|
|
569
|
+
),
|
|
570
|
+
ParameterDefinition(
|
|
571
|
+
name="min_covariance",
|
|
572
|
+
label="Minimum Covariance",
|
|
573
|
+
type=ParameterType.FLOAT,
|
|
574
|
+
),
|
|
575
|
+
ParameterDefinition(
|
|
576
|
+
name="max_covariance",
|
|
577
|
+
label="Maximum Covariance",
|
|
578
|
+
type=ParameterType.FLOAT,
|
|
579
|
+
),
|
|
580
|
+
],
|
|
581
|
+
tags=["multi_column", "covariance", "statistics"],
|
|
582
|
+
severity_default="medium",
|
|
583
|
+
),
|
|
584
|
+
ValidatorDefinition(
|
|
585
|
+
name="ColumnProduct",
|
|
586
|
+
display_name="Column Product",
|
|
587
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
588
|
+
description="Validates that product of columns equals a target column.",
|
|
589
|
+
parameters=[
|
|
590
|
+
ParameterDefinition(
|
|
591
|
+
name="columns",
|
|
592
|
+
label="Source Columns",
|
|
593
|
+
type=ParameterType.COLUMN_LIST,
|
|
594
|
+
description="Columns to multiply together",
|
|
595
|
+
required=True,
|
|
596
|
+
),
|
|
597
|
+
ParameterDefinition(
|
|
598
|
+
name="target_column",
|
|
599
|
+
label="Target Column",
|
|
600
|
+
type=ParameterType.COLUMN,
|
|
601
|
+
description="Column that should equal the product",
|
|
602
|
+
required=True,
|
|
603
|
+
),
|
|
604
|
+
ParameterDefinition(
|
|
605
|
+
name="tolerance",
|
|
606
|
+
label="Tolerance",
|
|
607
|
+
type=ParameterType.FLOAT,
|
|
608
|
+
default=0.0001,
|
|
609
|
+
min_value=0,
|
|
610
|
+
),
|
|
611
|
+
],
|
|
612
|
+
tags=["multi_column", "product", "calculation"],
|
|
613
|
+
severity_default="medium",
|
|
614
|
+
),
|
|
615
|
+
ValidatorDefinition(
|
|
616
|
+
name="ColumnDifference",
|
|
617
|
+
display_name="Column Difference",
|
|
618
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
619
|
+
description="Validates the difference between two columns.",
|
|
620
|
+
parameters=[
|
|
621
|
+
ParameterDefinition(
|
|
622
|
+
name="column_a",
|
|
623
|
+
label="First Column",
|
|
624
|
+
type=ParameterType.COLUMN,
|
|
625
|
+
required=True,
|
|
626
|
+
),
|
|
627
|
+
ParameterDefinition(
|
|
628
|
+
name="column_b",
|
|
629
|
+
label="Second Column",
|
|
630
|
+
type=ParameterType.COLUMN,
|
|
631
|
+
required=True,
|
|
632
|
+
),
|
|
633
|
+
ParameterDefinition(
|
|
634
|
+
name="expected_difference",
|
|
635
|
+
label="Expected Difference",
|
|
636
|
+
type=ParameterType.FLOAT,
|
|
637
|
+
description="Expected value of (A - B)",
|
|
638
|
+
),
|
|
639
|
+
ParameterDefinition(
|
|
640
|
+
name="min_difference",
|
|
641
|
+
label="Minimum Difference",
|
|
642
|
+
type=ParameterType.FLOAT,
|
|
643
|
+
),
|
|
644
|
+
ParameterDefinition(
|
|
645
|
+
name="max_difference",
|
|
646
|
+
label="Maximum Difference",
|
|
647
|
+
type=ParameterType.FLOAT,
|
|
648
|
+
),
|
|
649
|
+
ParameterDefinition(
|
|
650
|
+
name="tolerance",
|
|
651
|
+
label="Tolerance",
|
|
652
|
+
type=ParameterType.FLOAT,
|
|
653
|
+
default=0.0001,
|
|
654
|
+
min_value=0,
|
|
655
|
+
),
|
|
656
|
+
],
|
|
657
|
+
tags=["multi_column", "difference", "calculation"],
|
|
658
|
+
severity_default="medium",
|
|
659
|
+
),
|
|
660
|
+
ValidatorDefinition(
|
|
661
|
+
name="ColumnPercentage",
|
|
662
|
+
display_name="Column Percentage",
|
|
663
|
+
category=ValidatorCategory.MULTI_COLUMN,
|
|
664
|
+
description="Validates percentage relationship between columns.",
|
|
665
|
+
parameters=[
|
|
666
|
+
ParameterDefinition(
|
|
667
|
+
name="numerator_column",
|
|
668
|
+
label="Numerator Column",
|
|
669
|
+
type=ParameterType.COLUMN,
|
|
670
|
+
required=True,
|
|
671
|
+
),
|
|
672
|
+
ParameterDefinition(
|
|
673
|
+
name="denominator_column",
|
|
674
|
+
label="Denominator Column",
|
|
675
|
+
type=ParameterType.COLUMN,
|
|
676
|
+
required=True,
|
|
677
|
+
),
|
|
678
|
+
ParameterDefinition(
|
|
679
|
+
name="expected_percentage",
|
|
680
|
+
label="Expected Percentage",
|
|
681
|
+
type=ParameterType.FLOAT,
|
|
682
|
+
description="Expected percentage (0-100)",
|
|
683
|
+
),
|
|
684
|
+
ParameterDefinition(
|
|
685
|
+
name="min_percentage",
|
|
686
|
+
label="Minimum Percentage",
|
|
687
|
+
type=ParameterType.FLOAT,
|
|
688
|
+
min_value=0,
|
|
689
|
+
),
|
|
690
|
+
ParameterDefinition(
|
|
691
|
+
name="max_percentage",
|
|
692
|
+
label="Maximum Percentage",
|
|
693
|
+
type=ParameterType.FLOAT,
|
|
694
|
+
),
|
|
695
|
+
ParameterDefinition(
|
|
696
|
+
name="tolerance",
|
|
697
|
+
label="Tolerance",
|
|
698
|
+
type=ParameterType.FLOAT,
|
|
699
|
+
default=0.1,
|
|
700
|
+
min_value=0,
|
|
701
|
+
),
|
|
702
|
+
],
|
|
703
|
+
tags=["multi_column", "percentage", "calculation"],
|
|
704
|
+
severity_default="medium",
|
|
705
|
+
),
|
|
706
|
+
]
|