synthesized-io / insight

🧿 Metrics & Monitoring of Datasets
BSD 3-Clause "New" or "Revised" License
12 stars 0 forks source link

DiffCorrMatrix fix error trying to call abs() on np.array #117

Closed tomcarter23 closed 1 year ago

tomcarter23 commented 1 year ago

The following error was observed when trying to use the DiffCorrMatrix.summarize_result() function:

File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/insight/metrics/base.py", line 321, in __call__
    self._add_to_database(self.summarize_result(result),
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/insight/metrics/metrics_usage.py", line 85, in summarize_result
    return result.values.abs().max()
AttributeError: 'numpy.ndarray' object has no attribute 'abs'

This issue arises when calling .abs() on pd.DataFrame.values which returns a np.array

This PR fixes the error.

codecov[bot] commented 1 year ago

Codecov Report

Merging #117 (0380680) into master (d619081) will increase coverage by 0.1%. The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #117     +/-   ##
========================================
+ Coverage    79.3%   79.5%   +0.1%     
========================================
  Files          11      11             
  Lines         888     888             
  Branches      135     135             
========================================
+ Hits          705     706      +1     
+ Misses        141     140      -1     
  Partials       42      42             
Impacted Files Coverage Δ
src/insight/metrics/metrics_usage.py 94.1% <100.0%> (+1.9%) :arrow_up:
sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication