Verification
VerificationResult
dataclass
Results of verification.
Source code in tsumugi-python/tsumugi/verification.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
check_results: tuple[MetricAndCheckResult]
property
Results of checks with values of the corresponded metric and constraint.
Combines results of contraints with the corresponding values and descriptons of metrics. Collection of dataclasses.
Each element of the collection contains: - level (str): the same as in Check - check description (str): the same as in Check - conatraint message (str): the same as in Check - metric name (str): the name of the related metric - metric instance (str): column name or "*" - metric entity (str): Dataset or Column - metric value (str): the value of the related mtric - status (str): Success / Failure - constraint (str): the description of the constraint
checks: tuple[CheckResult]
property
Results of checks.
Returns results of all the checks as a collection of dataclasses. Each check can contain multiple Constraints.
Each check has the following attributes: - check (str): the name of the check - check level (str): the level of the check (Warning, Error) - check status (str): the overall check status (depends of level) - constraint (str): the description of constraint - contraint status (str): the status (Success, Failure) - contraint message (str): resulting message
metrics: tuple[MetricResult]
property
Computed metrics.
Returns all the metrics as a collection of dataclasses.
Each metric contains: - enitity (str): type of the metric (Dataset, Column) - instance (str): "*" in case of Dataset-level metric, name of the column otherwise - name (str): name of the metric - value (float): the value of the metric
row_level_results: DataFrame | None
property
Row-level results as it would be returned by Deequ.
The original DataFrame and a boolean status column per each Check.
__init__(df)
This constructor is internal and is not recommended to use.
Source code in tsumugi-python/tsumugi/verification.py
check_results_as_pandas()
Return check results as a Pandas DataFrame.
This method construct the new DataFrame each time! If you need it in a loop, it is recommended to cahce an output.
Source code in tsumugi-python/tsumugi/verification.py
checks_as_pandas()
Return checks as a Pandas DataFrame.
This method construct the new DataFrame each time! If you need it in a loop, it is recommended to cahce an output.
Source code in tsumugi-python/tsumugi/verification.py
metrics_as_pandas()
Return metrics as a Pandas DataFrame.
This method construct the new DataFrame each time! If you need it in a loop, it is recommended to cahce an output.
Source code in tsumugi-python/tsumugi/verification.py
VerificationRunBuilder
Helper class that simplify building of the Verification Run object.
Source code in tsumugi-python/tsumugi/verification.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
|
add_anomaly_detection(ad)
Add an anomaly detection check.
It is recommended to use AnomalyDetectionBuilder!
add_anomaly_detections(ads)
add_check(check)
add_checks(checks)
add_required_analyzer(analyzer)
Add a required analyzer metric of that will be computed anyway.
add_required_analyzers(analyzers)
run()
Run the suite.
The type of runtime is determined by the session attached to the provided DataFrame. For a Spark Connect session, it will add a serialized plan to the Suite and send the message to the Connect Server. For a Spark Classic session, it will directly call the JVM with the suite and a Java DataFrame.
Source code in tsumugi-python/tsumugi/verification.py
with_fs_repository_and_key(filepath, dataset_date, dataset_tags=None)
Add a FileSystem repository and date and tags for the ResultKey.
Source code in tsumugi-python/tsumugi/verification.py
with_row_level_results()
with_table_repository_and_key(table_name, dataset_date, dateset_tags=None)
Add a Table repository and date and tags for the ResultKey.
Source code in tsumugi-python/tsumugi/verification.py
VerificationSuite
Python-deequ compatibility class.
Source code in tsumugi-python/tsumugi/verification.py
on_data(data)
staticmethod
Return a VerificationRunBuilder for the given DataFrame object.