Open ASL-rmarshall opened 3 months ago
Implementing the changes for #705 should unblock this rule. However, it would be worth considering updating the empty
operator to recognize NaN
(np.nan
) as being empty as a more generic and robust fix:
results = np.where(self.value[target].isin(["", None, {None}, np.nan]), True, False)
^^^^^^^^
Changes for #705 have been implemented and this rule is now unblocked. However, I'm leaving this issue open for now so that the suggested fix in my previous comment can be considered.
JSON containing the full request Request.txt
Links to related JIRA Tickets
Rule Information
Describe the bug The rule uses the
record_count
with thegroup
andfilter
parameters to create a count of records for eachid
value whereparent_entity = 'StudyCell' and parent_rel = 'elementIds' and rel_type = 'reference'
and then tries to report any records for eachid
value that haverel_type = 'definition'
but the groupedrecord_count
result is eitherempty
orequal_to
0. However, although the (negative) test data contains a record that should be reported, the rule reports no errors. This is because, when there are no records meeting thefilter
criteria for a group, the merged record count column containsNaN
, andrecord_count
operation does not report 0 (zero) for groups that have no records meeting thefilter
criteria. See #705NaN
is not recognized as being empty by theempty
operator."Error" returned from Rule Engine
Expected behavior The
record_count
operation should return 0 (zero) for groups with no records meeting the specifiedfilter
criteria so that allrecord_count
results can be checked, and any remainingNaN
values should be replaced withNone
so that the rule failure is reported as expected: