pyspark-testframework 2.2.3__tar.gz → 2.3.0__tar.gz
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.
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/PKG-INFO +118 -130
- pyspark_testframework-2.3.0/README.md +320 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/pyspark_testframework.egg-info/PKG-INFO +118 -130
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/pyspark_testframework.egg-info/SOURCES.txt +2 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/_version.py +2 -2
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/__init__.py +2 -0
- pyspark_testframework-2.3.0/src/testframework/dataquality/tests/not_null.py +27 -0
- pyspark_testframework-2.3.0/tests/dataquality/dataframe/tests/test_NotNull.py +48 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tutorial.ipynb +126 -129
- pyspark_testframework-2.2.3/README.md +0 -332
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.github/labeler.yml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.github/release.yml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.github/workflows/cicd.yml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.github/workflows/cicd_woonstad_rotterdam.yml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.github/workflows/labeler.yml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.github/workflows/publish-to-pypi.yml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.gitignore +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/.pre-commit-config.yaml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/LICENSE +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/pyproject.toml +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/setup.cfg +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/pyspark_testframework.egg-info/dependency_links.txt +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/pyspark_testframework.egg-info/requires.txt +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/pyspark_testframework.egg-info/top_level.txt +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/__init__.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/__init__.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/_base.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/dataframe/__init__.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/dataframe/dataframe_tester.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/correct_value.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/integer_string.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/regex_tst.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/valid_category.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/valid_numeric_range.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/dataquality/tests/valid_numeric_string_range.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/utils/__init__.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/src/testframework/utils/decorators.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/conftest.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/test_DataFrameTester.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/tests/test_CorrectValue.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/tests/test_IntegerString.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/tests/test_RegexTest.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/tests/test_ValidCategory.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/tests/test_ValidNumericRange.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/dataquality/dataframe/tests/test_ValidNumericStringRange.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/utils/decorators/test_account_for_nullable.py +0 -0
- {pyspark_testframework-2.2.3 → pyspark_testframework-2.3.0}/tests/utils/decorators/test_allowed_col_types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyspark-testframework
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Testframework for PySpark DataFrames
|
|
5
5
|
Author-email: Woonstad Rotterdam <info@woonstadrotterdam.nl>, Tomer Gabay <tomer.gabay@woonstadrotterdam.nl>, Vincent van der Meij <vincent.van.der.meij@woonstadrotterdam.nl>, Tiddo Loos <tiddo.loos@woonstadrotterdam.nl>, Ben Verhees <ben.verhees@woonstadrotterdam.nl>
|
|
6
6
|
License: MIT License
|
|
@@ -54,18 +54,6 @@ Requires-Dist: ruff==0.4.8; extra == "dev"
|
|
|
54
54
|
|
|
55
55
|
# pyspark-testframework
|
|
56
56
|
|
|
57
|
-
⏳ **Work in progress**
|
|
58
|
-
|
|
59
|
-

|
|
60
|
-

|
|
61
|
-

|
|
62
|
-

|
|
63
|
-

|
|
64
|
-

|
|
65
|
-

|
|
66
|
-

|
|
67
|
-
&width=145>)
|
|
68
|
-
|
|
69
57
|
The goal of the `pyspark-testframework` is to provide a simple way to create tests for PySpark DataFrames. The test results are returned in DataFrame format as well.
|
|
70
58
|
|
|
71
59
|
# Tutorial
|
|
@@ -87,7 +75,7 @@ spark = SparkSession.builder.appName("PySparkTestFrameworkTutorial").getOrCreate
|
|
|
87
75
|
# Define the schema
|
|
88
76
|
schema = StructType(
|
|
89
77
|
[
|
|
90
|
-
StructField("
|
|
78
|
+
StructField("id", IntegerType(), True),
|
|
91
79
|
StructField("street", StringType(), True),
|
|
92
80
|
StructField("house_number", IntegerType(), True),
|
|
93
81
|
]
|
|
@@ -107,15 +95,15 @@ df = spark.createDataFrame(data, schema)
|
|
|
107
95
|
df.show(truncate=False)
|
|
108
96
|
```
|
|
109
97
|
|
|
110
|
-
|
|
111
|
-
|
|
|
112
|
-
|
|
113
|
-
|1
|
|
114
|
-
|2
|
|
115
|
-
|3
|
|
116
|
-
|4
|
|
117
|
-
|5
|
|
118
|
-
|
|
98
|
+
+---+--------------------+------------+
|
|
99
|
+
|id |street |house_number|
|
|
100
|
+
+---+--------------------+------------+
|
|
101
|
+
|1 |Rochussenstraat |27 |
|
|
102
|
+
|2 |Coolsingel |31 |
|
|
103
|
+
|3 |%Witte de Withstraat|27 |
|
|
104
|
+
|4 |Lijnbaan |-3 |
|
|
105
|
+
|5 |null |13 |
|
|
106
|
+
+---+--------------------+------------+
|
|
119
107
|
|
|
120
108
|
**Import and initialize the `DataFrameTester`**
|
|
121
109
|
|
|
@@ -126,7 +114,7 @@ from testframework.dataquality import DataFrameTester
|
|
|
126
114
|
```python
|
|
127
115
|
df_tester = DataFrameTester(
|
|
128
116
|
df=df,
|
|
129
|
-
primary_key="
|
|
117
|
+
primary_key="id",
|
|
130
118
|
spark=spark,
|
|
131
119
|
)
|
|
132
120
|
```
|
|
@@ -140,32 +128,32 @@ from testframework.dataquality.tests import ValidNumericRange, RegexTest
|
|
|
140
128
|
**Initialize the `RegexTest` to test for valid street names**
|
|
141
129
|
|
|
142
130
|
```python
|
|
143
|
-
|
|
144
|
-
name="
|
|
131
|
+
valid_street_format = RegexTest(
|
|
132
|
+
name="ValidStreetFormat",
|
|
145
133
|
pattern=r"^[A-Z][a-zéèáàëï]*([ -][A-Z]?[a-zéèáàëï]*)*$",
|
|
146
134
|
)
|
|
147
135
|
```
|
|
148
136
|
|
|
149
|
-
**Run `
|
|
137
|
+
**Run `valid_street_format` on the _street_ column using the `.test()` method of `DataFrameTester`.**
|
|
150
138
|
|
|
151
139
|
```python
|
|
152
140
|
df_tester.test(
|
|
153
141
|
col="street",
|
|
154
|
-
test=
|
|
155
|
-
nullable=False, # nullable, hence null values are converted to
|
|
156
|
-
description="
|
|
142
|
+
test=valid_street_format,
|
|
143
|
+
nullable=False, # nullable is False, hence null values are converted to False
|
|
144
|
+
description="Street is in valid Dutch street format.",
|
|
157
145
|
).show(truncate=False)
|
|
158
146
|
```
|
|
159
147
|
|
|
160
|
-
|
|
161
|
-
|
|
|
162
|
-
|
|
163
|
-
|1
|
|
164
|
-
|2
|
|
165
|
-
|3
|
|
166
|
-
|4
|
|
167
|
-
|5
|
|
168
|
-
|
|
148
|
+
+---+--------------------+-------------------------+
|
|
149
|
+
|id |street |street__ValidStreetFormat|
|
|
150
|
+
+---+--------------------+-------------------------+
|
|
151
|
+
|1 |Rochussenstraat |true |
|
|
152
|
+
|2 |Coolsingel |true |
|
|
153
|
+
|3 |%Witte de Withstraat|false |
|
|
154
|
+
|4 |Lijnbaan |true |
|
|
155
|
+
|5 |null |false |
|
|
156
|
+
+---+--------------------+-------------------------+
|
|
169
157
|
|
|
170
158
|
**Run the `IntegerString` test on the _number_ column**
|
|
171
159
|
|
|
@@ -175,19 +163,19 @@ By setting the `return_failed_rows` parameter to `True`, we can get only the row
|
|
|
175
163
|
df_tester.test(
|
|
176
164
|
col="house_number",
|
|
177
165
|
test=ValidNumericRange(
|
|
178
|
-
min_value=
|
|
166
|
+
min_value=1,
|
|
179
167
|
),
|
|
180
|
-
nullable=
|
|
181
|
-
# description is optional, let's not define it for illustration purposes
|
|
168
|
+
nullable=False,
|
|
169
|
+
# description="House number is in a valid format" # optional, let's not define it for illustration purposes
|
|
182
170
|
return_failed_rows=True, # only return the failed rows
|
|
183
171
|
).show()
|
|
184
172
|
```
|
|
185
173
|
|
|
186
|
-
|
|
187
|
-
|
|
|
188
|
-
|
|
189
|
-
|
|
|
190
|
-
|
|
174
|
+
+---+------------+-------------------------------+
|
|
175
|
+
| id|house_number|house_number__ValidNumericRange|
|
|
176
|
+
+---+------------+-------------------------------+
|
|
177
|
+
| 4| -3| false|
|
|
178
|
+
+---+------------+-------------------------------+
|
|
191
179
|
|
|
192
180
|
**Let's take a look at the test results of the DataFrame using the `.results` attribute.**
|
|
193
181
|
|
|
@@ -195,15 +183,15 @@ df_tester.test(
|
|
|
195
183
|
df_tester.results.show(truncate=False)
|
|
196
184
|
```
|
|
197
185
|
|
|
198
|
-
|
|
199
|
-
|
|
|
200
|
-
|
|
201
|
-
|1
|
|
202
|
-
|2
|
|
203
|
-
|3
|
|
204
|
-
|4
|
|
205
|
-
|5
|
|
206
|
-
|
|
186
|
+
+---+-------------------------+-------------------------------+
|
|
187
|
+
|id |street__ValidStreetFormat|house_number__ValidNumericRange|
|
|
188
|
+
+---+-------------------------+-------------------------------+
|
|
189
|
+
|1 |true |true |
|
|
190
|
+
|2 |true |true |
|
|
191
|
+
|3 |false |true |
|
|
192
|
+
|4 |true |false |
|
|
193
|
+
|5 |false |true |
|
|
194
|
+
+---+-------------------------+-------------------------------+
|
|
207
195
|
|
|
208
196
|
**We can use `.descriptions` or `.descriptions_df` to get the descriptions of the tests.**
|
|
209
197
|
|
|
@@ -215,8 +203,8 @@ For example to create reports for the business with more detailed information th
|
|
|
215
203
|
df_tester.descriptions
|
|
216
204
|
```
|
|
217
205
|
|
|
218
|
-
{'
|
|
219
|
-
'house_number__ValidNumericRange': 'house_number__ValidNumericRange(min_value=
|
|
206
|
+
{'street__ValidStreetFormat': 'Street is in valid Dutch street format.',
|
|
207
|
+
'house_number__ValidNumericRange': 'house_number__ValidNumericRange(min_value=1.0, max_value=inf)'}
|
|
220
208
|
|
|
221
209
|
```python
|
|
222
210
|
df_tester.description_df.show(truncate=False)
|
|
@@ -225,8 +213,8 @@ df_tester.description_df.show(truncate=False)
|
|
|
225
213
|
+-------------------------------+-------------------------------------------------------------+
|
|
226
214
|
|test |description |
|
|
227
215
|
+-------------------------------+-------------------------------------------------------------+
|
|
228
|
-
|
|
|
229
|
-
|house_number__ValidNumericRange|house_number__ValidNumericRange(min_value=
|
|
216
|
+
|street__ValidStreetFormat |Street is in valid Dutch street format. |
|
|
217
|
+
|house_number__ValidNumericRange|house_number__ValidNumericRange(min_value=1.0, max_value=inf)|
|
|
230
218
|
+-------------------------------+-------------------------------------------------------------+
|
|
231
219
|
|
|
232
220
|
### Custom tests
|
|
@@ -237,18 +225,18 @@ Let's do this using a custom test which should tests that every house has a bath
|
|
|
237
225
|
|
|
238
226
|
```python
|
|
239
227
|
rooms = [
|
|
240
|
-
(1, "living room"),
|
|
241
|
-
(1, "
|
|
242
|
-
(1, "kitchen"),
|
|
243
|
-
(1, "bed room"),
|
|
244
|
-
(2, "living room"),
|
|
245
|
-
(2, "bed room"),
|
|
246
|
-
(2, "kitchen"),
|
|
228
|
+
(1,1, "living room"),
|
|
229
|
+
(2,1, "bathroom"),
|
|
230
|
+
(3,1, "kitchen"),
|
|
231
|
+
(4,1, "bed room"),
|
|
232
|
+
(5,2, "living room"),
|
|
233
|
+
(6,2, "bed room"),
|
|
234
|
+
(7,2, "kitchen"),
|
|
247
235
|
]
|
|
248
236
|
|
|
249
237
|
schema_rooms = StructType(
|
|
250
|
-
[
|
|
251
|
-
StructField("
|
|
238
|
+
[ StructField("id", IntegerType(), True),
|
|
239
|
+
StructField("house_id", IntegerType(), True),
|
|
252
240
|
StructField("room", StringType(), True),
|
|
253
241
|
]
|
|
254
242
|
)
|
|
@@ -258,38 +246,38 @@ room_df = spark.createDataFrame(rooms, schema=schema_rooms)
|
|
|
258
246
|
room_df.show(truncate=False)
|
|
259
247
|
```
|
|
260
248
|
|
|
261
|
-
|
|
262
|
-
|
|
|
263
|
-
|
|
264
|
-
|1
|
|
265
|
-
|1
|
|
266
|
-
|1
|
|
267
|
-
|1
|
|
268
|
-
|2
|
|
269
|
-
|2
|
|
270
|
-
|2
|
|
271
|
-
|
|
249
|
+
+---+--------+-----------+
|
|
250
|
+
|id |house_id|room |
|
|
251
|
+
+---+--------+-----------+
|
|
252
|
+
|1 |1 |living room|
|
|
253
|
+
|2 |1 |bathroom |
|
|
254
|
+
|3 |1 |kitchen |
|
|
255
|
+
|4 |1 |bed room |
|
|
256
|
+
|5 |2 |living room|
|
|
257
|
+
|6 |2 |bed room |
|
|
258
|
+
|7 |2 |kitchen |
|
|
259
|
+
+---+--------+-----------+
|
|
272
260
|
|
|
273
261
|
To create a custom test, we should create a pyspark DataFrame which contains the same primary_key column as the DataFrame to be tested using the `DataFrameTester`.
|
|
274
262
|
|
|
275
263
|
Let's create a boolean column that indicates whether the house has a bath room or not.
|
|
276
264
|
|
|
277
265
|
```python
|
|
278
|
-
|
|
279
|
-
F.max(F.when(F.col("room") == "
|
|
280
|
-
"
|
|
266
|
+
house_has_bathroom = room_df.groupBy("house_id").agg(
|
|
267
|
+
F.max(F.when(F.col("room") == "bathroom", True).otherwise(False)).alias(
|
|
268
|
+
"has_bathroom"
|
|
281
269
|
)
|
|
282
270
|
)
|
|
283
271
|
|
|
284
|
-
|
|
272
|
+
house_has_bathroom.show(truncate=False)
|
|
285
273
|
```
|
|
286
274
|
|
|
287
|
-
|
|
288
|
-
|
|
|
289
|
-
|
|
290
|
-
|1
|
|
291
|
-
|2
|
|
292
|
-
|
|
275
|
+
+--------+------------+
|
|
276
|
+
|house_id|has_bathroom|
|
|
277
|
+
+--------+------------+
|
|
278
|
+
|1 |true |
|
|
279
|
+
|2 |false |
|
|
280
|
+
+--------+------------+
|
|
293
281
|
|
|
294
282
|
**We can add this 'custom test' to the `DataFrameTester` using `add_custom_test_result`.**
|
|
295
283
|
|
|
@@ -297,22 +285,22 @@ In the background, all kinds of data validation checks are done by `DataFrameTes
|
|
|
297
285
|
|
|
298
286
|
```python
|
|
299
287
|
df_tester.add_custom_test_result(
|
|
300
|
-
result=
|
|
301
|
-
name="
|
|
302
|
-
description="House has a
|
|
288
|
+
result=house_has_bathroom.withColumnRenamed("house_id", "id"),
|
|
289
|
+
name="has_bathroom",
|
|
290
|
+
description="House has a bathroom",
|
|
303
291
|
# fillna_value=0, # optional; by default null.
|
|
304
292
|
).show(truncate=False)
|
|
305
293
|
```
|
|
306
294
|
|
|
307
|
-
|
|
308
|
-
|
|
|
309
|
-
|
|
310
|
-
|1
|
|
311
|
-
|2
|
|
312
|
-
|3
|
|
313
|
-
|4
|
|
314
|
-
|5
|
|
315
|
-
|
|
295
|
+
+---+------------+
|
|
296
|
+
|id |has_bathroom|
|
|
297
|
+
+---+------------+
|
|
298
|
+
|1 |true |
|
|
299
|
+
|2 |false |
|
|
300
|
+
|3 |null |
|
|
301
|
+
|4 |null |
|
|
302
|
+
|5 |null |
|
|
303
|
+
+---+------------+
|
|
316
304
|
|
|
317
305
|
**Despite that the data whether a house has a bath room is not available in the house DataFrame; we can still add the custom test to the `DataFrameTester` object.**
|
|
318
306
|
|
|
@@ -320,23 +308,23 @@ df_tester.add_custom_test_result(
|
|
|
320
308
|
df_tester.results.show(truncate=False)
|
|
321
309
|
```
|
|
322
310
|
|
|
323
|
-
|
|
324
|
-
|
|
|
325
|
-
|
|
326
|
-
|1
|
|
327
|
-
|2
|
|
328
|
-
|3
|
|
329
|
-
|4
|
|
330
|
-
|5
|
|
331
|
-
|
|
311
|
+
+---+-------------------------+-------------------------------+------------+
|
|
312
|
+
|id |street__ValidStreetFormat|house_number__ValidNumericRange|has_bathroom|
|
|
313
|
+
+---+-------------------------+-------------------------------+------------+
|
|
314
|
+
|1 |true |true |true |
|
|
315
|
+
|2 |true |true |false |
|
|
316
|
+
|3 |false |true |null |
|
|
317
|
+
|4 |true |false |null |
|
|
318
|
+
|5 |false |true |null |
|
|
319
|
+
+---+-------------------------+-------------------------------+------------+
|
|
332
320
|
|
|
333
321
|
```python
|
|
334
322
|
df_tester.descriptions
|
|
335
323
|
```
|
|
336
324
|
|
|
337
|
-
{'
|
|
338
|
-
'house_number__ValidNumericRange': 'house_number__ValidNumericRange(min_value=
|
|
339
|
-
'
|
|
325
|
+
{'street__ValidStreetFormat': 'Street is in valid Dutch street format.',
|
|
326
|
+
'house_number__ValidNumericRange': 'house_number__ValidNumericRange(min_value=1.0, max_value=inf)',
|
|
327
|
+
'has_bathroom': 'House has a bathroom'}
|
|
340
328
|
|
|
341
329
|
**We can also get a summary of the test results using the `.summary` attribute.**
|
|
342
330
|
|
|
@@ -347,9 +335,9 @@ df_tester.summary.show(truncate=False)
|
|
|
347
335
|
+-------------------------------+-------------------------------------------------------------+-------+--------+-----------------+--------+-----------------+
|
|
348
336
|
|test |description |n_tests|n_passed|percentage_passed|n_failed|percentage_failed|
|
|
349
337
|
+-------------------------------+-------------------------------------------------------------+-------+--------+-----------------+--------+-----------------+
|
|
350
|
-
|
|
|
351
|
-
|house_number__ValidNumericRange|house_number__ValidNumericRange(min_value=
|
|
352
|
-
|
|
|
338
|
+
|street__ValidStreetFormat |Street is in valid Dutch street format. |5 |3 |60.0 |2 |40.0 |
|
|
339
|
+
|house_number__ValidNumericRange|house_number__ValidNumericRange(min_value=1.0, max_value=inf)|5 |4 |80.0 |1 |20.0 |
|
|
340
|
+
|has_bathroom |House has a bathroom |2 |1 |50.0 |1 |50.0 |
|
|
353
341
|
+-------------------------------+-------------------------------------------------------------+-------+--------+-----------------+--------+-----------------+
|
|
354
342
|
|
|
355
343
|
**If you want to see all rows that failed any of the tests, you can use the `.failed_tests` attribute.**
|
|
@@ -358,14 +346,14 @@ df_tester.summary.show(truncate=False)
|
|
|
358
346
|
df_tester.failed_tests.show(truncate=False)
|
|
359
347
|
```
|
|
360
348
|
|
|
361
|
-
|
|
362
|
-
|
|
|
363
|
-
|
|
364
|
-
|2
|
|
365
|
-
|3
|
|
366
|
-
|4
|
|
367
|
-
|5
|
|
368
|
-
|
|
349
|
+
+---+-------------------------+-------------------------------+------------+
|
|
350
|
+
|id |street__ValidStreetFormat|house_number__ValidNumericRange|has_bathroom|
|
|
351
|
+
+---+-------------------------+-------------------------------+------------+
|
|
352
|
+
|2 |true |true |false |
|
|
353
|
+
|3 |false |true |null |
|
|
354
|
+
|4 |true |false |null |
|
|
355
|
+
|5 |false |true |null |
|
|
356
|
+
+---+-------------------------+-------------------------------+------------+
|
|
369
357
|
|
|
370
358
|
**Of course, you can also see all rows that passed all tests using the `.passed_tests` attribute.**
|
|
371
359
|
|
|
@@ -373,8 +361,8 @@ df_tester.failed_tests.show(truncate=False)
|
|
|
373
361
|
df_tester.passed_tests.show(truncate=False)
|
|
374
362
|
```
|
|
375
363
|
|
|
376
|
-
|
|
377
|
-
|
|
|
378
|
-
|
|
379
|
-
|1
|
|
380
|
-
|
|
364
|
+
+---+-------------------------+-------------------------------+------------+
|
|
365
|
+
|id |street__ValidStreetFormat|house_number__ValidNumericRange|has_bathroom|
|
|
366
|
+
+---+-------------------------+-------------------------------+------------+
|
|
367
|
+
|1 |true |true |true |
|
|
368
|
+
+---+-------------------------+-------------------------------+------------+
|