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
import logging
import numpy as np
import pandas as pd
from evidently.metrics import ColumnDriftMetric
from evidently.report import Report
from evidently.ui.base import Project
from evidently.ui.workspace import Workspace
logging.basicConfig(level=logging.DEBUG)
def create_evidently_project(workspace_name: str, project_name: str) -> Project:
ws = Workspace.create(workspace_name)
if projs := ws.search_project(project_name):
proj = projs[0]
else:
proj = ws.create_project(project_name)
return proj
proj = create_evidently_project("test_error_bug", "test_error_bug")
data = pd.DataFrame(
{"vals": [np.nan] * 100}
)
ref_data = pd.DataFrame(
{"vals": [1] * 1000},
)
ref_data.to_parquet("ref_data.parquet", index=False)
used_features = ["vals"]
rep = Report(
metrics=[
*[ColumnDriftMetric(column_name=column) for column in used_features],
],
)
rep.run(reference_data=ref_data, current_data=data)
try:
rep._inner_suite.raise_for_error()
except Exception as e:
print(e)
rep.save(f"test_error_bug/{str(proj.id)}/snapshots/{str(rep.id)}.json")
If u open generated report you get 500 and
File "evidently\src\evidently\report\report.py", line 212, in _build_dashboard_info
html_info = renderer.render_html(test)
File "evidently\src\evidently\metrics\data_drift\column_drift_metric.py", line 322, in render_html
if result.drift_detected:
AttributeError: 'MetricResult' object has no attribute 'drift_detected'
The text was updated successfully, but these errors were encountered:
c0t0ber
changed the title
UI crashes when opening a report or tests if one of the metrics or tests ends with an error
UI 500 when opening a report or tests if one of the metrics or tests ends with an error
Mar 19, 2024
If u open generated report you get 500 and
The text was updated successfully, but these errors were encountered: