Open ASL-rmarshall opened 1 week ago
I haven't (yet) reported this as blocking a rule because I have used a workaround to prevent pre-processing creating empty datasets - in DDF00037, I have used a left join (Join Type: left
) in Match Datasets
instead of an inner join that would be more logical for the rule.
If the
equal_to
operator is used within eitherall
orany
and the rule is executed for an empty dataset (either initially empty or empty as the result of pre-processing an inner join specified inMatch Datasets
), one of the following errors will be reported:all
:any
:The error occurs because the data type of an empty
pd.Series
defaults to float64, and this cannot be combined with the prespecified boolean value for the combined result of theall
(business_rules.engine.py line 42) orany
(business_rules.engine.py line 53).A possible fix might be to explicitly cast the result of the
equal_to
operator asbool
, e.g. by changing line 162 of dataframe_operators.py:Note that the same issue is likely to affect may other operators when used in combination with
all
/any
and validating empty datasets, but a similar fix could be applied to those.