You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# more comprehensive matching; note that tests which start with test_i and not test_integer are not matched and must be added here
281
+
282
+
PYTEST_ARG: ["tests/integration/test_integration.py -k 'test_a or test_b or test_c or test_d or test_e or test_f or test_g or test_h or test_integer or test_j or test_k or test_l or test_m'", "tests/integration/test_integration.py -k 'test_n or test_o or test_p or test_q or test_r or test_s or test_t or test_u or test_v or test_w or test_x or test_y or test_z'"]
Passing ``None`` as the argument is equivalent to :func:`~datajudge.utils.filternull_element` but triggers a warning.
56
+
The current default of :func:`~datajudge.utils.filternull_element`
57
+
Cause (possibly often unintended) changes in behavior when the users adds a second column
58
+
(filtering no longer can trigger at all).
59
+
The default will be changed to :func:`~datajudge.utils.filternull_element_or_tuple_all` in future versions.
60
+
To silence the warning, set ``filter_func`` explicitly..
61
+
48
62
49
63
There are two ways to do some post processing of the data obtained from the
50
64
database by providing a function to be executed. In general, no postprocessing
@@ -63,6 +77,29 @@ class Uniques(Constraint, abc.ABC):
63
77
(eager or lazy) of the same type as the type of the values of the column (in their
64
78
Python equivalent).
65
79
80
+
Furthermore, the `max_relative_violations` parameter can be used to set a tolerance
81
+
threshold for the proportion of elements in the data that can violate the constraint
82
+
(default: 0).
83
+
Setting this argument is currently not supported for `UniquesEquality`.
84
+
85
+
For `UniquesSubset`, by default,
86
+
the number of occurrences affects the computed fraction of violations.
87
+
To disable this weighting, set `compare_distinct=True`.
88
+
This argument does not have an effect on the test results for other `Uniques` constraints,
89
+
or if `max_relative_violations` is 0.
90
+
91
+
By default, the assertion messages make use of sets,
92
+
thus, they may differ from run to run despite the exact same situation being present,
93
+
and can have an arbitrary length.
94
+
To enforce a reproducible, limited output via (e.g.) sorting and slicing,
95
+
set `output_processors` to a callable or a list of callables. By default, only the first 100 elements are displayed (:func:`~datajudge.utils.output_processor_limit`).
96
+
97
+
Each callable takes in two collections, and returns modified (e.g. sorted) versions of them.
98
+
In most cases, the second argument is simply None,
99
+
but for `UniquesSubset` it is the counts of each of the elements.
100
+
The suggested functions are :func:`~datajudge.utils.output_processor_sort` and :func:`~datajudge.utils.output_processor_limit`
101
+
- see their respective docstrings for details.
102
+
66
103
One use is of this constraint is to test for consistency in columns with expected
0 commit comments