@@ -114,23 +114,23 @@ def assert_data(
114
114
115
115
Example:
116
116
```python
117
- # Validate that the Dataframe has at least 2 rows
117
+ # Validate that the Dataframe has at least 1 row
118
118
119
119
(
120
120
iris
121
- .check.assert_data(lambda df: df.shape[0]>1 )
121
+ .check.assert_data(lambda df: df.shape[0]>0 )
122
122
123
123
# Or customize the message displayed when alert fails
124
- .check.assert_data(lambda df: df.shape[0]>1 , "Assertion failed, DataFrame has no rows!")
124
+ .check.assert_data(lambda df: df.shape[0]>0 , "Assertion failed, DataFrame has no rows!")
125
125
126
126
# Or show a warning instead of raising an exception
127
- .check.assert_data(lambda df: s.shape[0]>1 , "FYI Series has no rows", raise_exception=False)
127
+ .check.assert_data(lambda df: s.shape[0]>0 , "FYI DataFrame has no rows", raise_exception=False)
128
128
129
129
# Or show a message if it passes, and raise a specific exception (ValueError) if it fails.
130
130
.check.assert_data(
131
131
lambda df: s.shape[0]>1,
132
- fail_message="FYI Series has no rows",
133
- pass_message="Series has rows !",
132
+ fail_message="FYI DataFrame has 0 rows",
133
+ pass_message="DataFrame has at least 1 row !",
134
134
exception_to_raise=ValueError,
135
135
verbose=True # To show pass_message when assertion passes
136
136
)
0 commit comments