Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine Draper committed May 14, 2024
1 parent 4a4d44a commit d5c5b8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions whylabs_toolkit/monitor/diagnoser/models/diagnosis_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class FailureRecord(BaseModel):
byTypeCount: List[NamedCount]

def describe(self) -> str:
failures = pd.DataFrame([c.to_tuple() for c in self.byColumnCount], columns=['column', 'count'])
failures = pd.DataFrame([c.to_tuple() for c in self.byColumnCount], columns=["column", "count"])
failure_types = [t.name for t in self.byTypeCount]
if len(failures) == 0:
return "No failures were detected."
Expand All @@ -116,7 +116,7 @@ class AnomalyRecord(BaseModel):
byColumnBatchCount: List[NamedCount]

def describe(self) -> str:
counts = pd.DataFrame([c.to_tuple() for c in self.byColumnCount], columns=['column', 'count'])
counts = pd.DataFrame([c.to_tuple() for c in self.byColumnCount], columns=["column", "count"])
max_count = int(self.maxAnomalyCount)
max_pct = max_count * 100 / self.batchCount
mean_count = float(self.meanAnomalyCount)
Expand Down Expand Up @@ -208,8 +208,8 @@ def describe_conditions(self) -> str:
idx, values = zip(*count_tuples)
count_by_col = pd.Series(values, idx)
cols_with_count = filter_by_index(cols.tolist(), count_by_col).sort_values(ascending=False)
cols_with_count.index.name = 'column'
cols_with_count.name = 'count'
cols_with_count.index.name = "column"
cols_with_count.name = "count"
text += describe_truncated_table(pd.DataFrame(cols_with_count).reset_index())
text += f"\nAccounting for {cols_with_count.sum()} anomalies out of " f"{count_by_col.sum()}\n"

Expand Down

0 comments on commit d5c5b8d

Please sign in to comment.