Open khangt1k25 opened 1 year ago
Hey @khangt1k25
the quick solution is to change import from from evidently.pipeline.column_mapping import ColumnMapping
to from evidently import ColumnMapping
Although we'll check what's going on with the initial import
Hi @emeli-dral , I changed that but it's still error. I figure out that the error come from two lines of code.
from evidently.report import Report from evidently.metric_preset import DataDriftPreset
Hi @khangt1k25 ! Can you check your pydantic version? Looks like this assertion fails because of old pydantic, try upgrade it. We also should add constraints on it in our requirements
related #568
I have a python code with Evidently library. But when i try to import like this. It causes Assertion error.
` import evidently
from evidently import ColumnMapping
from evidently.report import Report
from evidently.metric_preset import DataDriftPreset `
Traceback (most recent call last): File "/home/app.py", line 4, in <module> import evidently_client as evi File "/home/evidently_client.py", line 4, in <module> from evidently.report import Report File "/home/khangnt/anaconda3/envs/scoring/lib/python3.10/site-packages/evidently/report/__init__.py", line 1, in <module> from .report import Report File "/home/khangnt/anaconda3/envs/scoring/lib/python3.10/site-packages/evidently/report/report.py", line 14, in <module> from evidently.metric_preset.metric_preset import MetricPreset File "/home/khangnt/anaconda3/envs/scoring/lib/python3.10/site-packages/evidently/metric_preset/__init__.py", line 1, in <module> from .classification_performance import ClassificationPreset File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/evidently/metric_preset/classification_performance.py", line 5, in <module> from evidently.calculations.classification_performance import get_prediction_data File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/evidently/calculations/classification_performance.py", line 18, in <module> from evidently.metric_results import Boxes File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/evidently/metric_results.py", line 28, in <module> class ConfusionMatrix(MetricResultField): File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/pydantic/main.py", line 95, in __new__ fields[ann_name] = Field.infer( File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/pydantic/fields.py", line 92, in infer return cls( File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/pydantic/fields.py", line 77, in __init__ self.prepare() File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/pydantic/fields.py", line 133, in prepare self._populate_sub_fields() File "/home/khangnt/anaconda3/envs/ss/lib/python3.10/site-packages/pydantic/fields.py", line 171, in _populate_sub_fields assert issubclass(origin, Mapping) AssertionError