Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run DataDriftPreset for selected columns #473

Closed
userkkw opened this issue Dec 6, 2022 · 2 comments
Closed

unable to run DataDriftPreset for selected columns #473

userkkw opened this issue Dec 6, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@userkkw
Copy link

userkkw commented Dec 6, 2022

evidently == 0.2.0

Hi all, when I try to run the data drift report with selected columns from the sample housing data, I encounter the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-31-b410202d09b8> in <module>
      7     ]
      8 )
----> 9 report.run(reference_data=reference_data, current_data=current_data)

/opt/conda/lib/python3.7/site-packages/evidently/report/report.py in run(self, reference_data, current_data, column_mapping)
     90 
     91         self._inner_suite.verify()
---> 92         self._inner_suite.run_calculate(data)
     93 
     94     def as_dict(self) -> dict:

/opt/conda/lib/python3.7/site-packages/evidently/suite/base_suite.py in run_calculate(self, data)
    238 
    239             calculations = {}
--> 240             for metric, calculation in execution_graph.get_metric_execution_iterator():
    241                 if calculation not in calculations:
    242                     logging.debug(f"Executing {type(calculation)}...")

/opt/conda/lib/python3.7/site-packages/evidently/suite/execution_graph.py in get_metric_execution_iterator(self)
     37         metric_to_calculations = {}
     38         for metric_type, metrics in aggregated.items():
---> 39             metrics_by_parameters: Dict[tuple, List[Metric]] = functools.reduce(_aggregate_by_parameters, metrics, {})
     40 
     41             for metric in metrics:

/opt/conda/lib/python3.7/site-packages/evidently/suite/execution_graph.py in _aggregate_by_parameters(agg, metric)
     54 
     55 def _aggregate_by_parameters(agg: dict, metric: Metric) -> dict:
---> 56     agg[metric.get_parameters()] = agg.get(metric.get_parameters(), []) + [metric]
     57     return agg

TypeError: unhashable type: 'list'

The python code is following:

columns = ["AveBedrms","MedInc"]
report = Report(
    metrics=[
        DataDriftPreset(
            columns = columns,
        ),
    ]
)
report.run(reference_data=reference_data, current_data=current_data)
@emeli-dral emeli-dral added the bug Something isn't working label Dec 7, 2022
@emeli-dral
Copy link
Contributor

Hi @userkkw ,
Thank you for pointing this out!

fixed in #476

You can use it now if you rebuild the package from the source, and fix will be included in the next release.

@emeli-dral
Copy link
Contributor

Fix is released in 0.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants