Error when a report is run without reference_data even though it is optional
Issue:
When generating a report with DataQualityPreset() metric, the reference_data is optional as described here. However, calling this method without reference_data leads to this error:
data_quality_report.run(current_data=current_data,column_mapping=column_mapping)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_4117/1444958639.py in <module>
1 column_mapping = ColumnMapping(datetime="datetime_end",numerical_features=features[1:])
----> 2 data_quality_report.run(current_data=current_data,column_mapping=column_mapping)
TypeError: run() missing 1 required keyword-only argument: 'reference_data'
Cause:
The reference_data argument is optional when running the run() method of Report class https://github.com/evidentlyai/evidently/blob/098b95b9343c390ba9910be4bb85755215b7d8b2/src/evidently/report/report.py#L42
But it is not assigned a None unlike column_mapping here:
https://github.com/evidentlyai/evidently/blob/098b95b9343c390ba9910be4bb85755215b7d8b2/src/evidently/report/report.py#L44
Solution (suggestion):
Initialize the optional reference_data as None in https://github.com/evidentlyai/evidently/blob/098b95b9343c390ba9910be4bb85755215b7d8b2/src/evidently/report/report.py#L42
I am experiencing the same problem.
Hi @GwenVCX, @abhitoqua,
You should pass the reference data as None in this scenario.
data_quality_report = Report(metrics=[
DataQualityPreset()
])
data_quality_report.run(current_data=current, reference_data=None)
data_quality_report
That worked. Thank you @elenasamuylova!