Skip to content

Commit

Permalink
Fix new flake8 lint errors
Browse files Browse the repository at this point in the history
They seem to only happen with Python 3.12, which I don't have locally
yet and I am not seeing these lint errors locally either.
  • Loading branch information
heyLu committed Feb 26, 2024
1 parent 3cc4e7e commit 136a859
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions es_stream_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ async def aggregation_svg(es, request: Request, query: Query):
bucket_data['sub_buckets'].insert(0, {
'key': f"no value for {query.aggregation_terms}",
'count': amount,
'percentage': f"{(amount/max_count) * 100:.2f}%",
'percentage': f"{(amount / max_count) * 100:.2f}%",
'height': int((amount / max_count) * 100),
'offset_y': offset_y - int((amount / max_count) * 100),
'color': '#dddddd',
Expand All @@ -418,7 +418,7 @@ async def aggregation_svg(es, request: Request, query: Query):
continue
pos_y = 100 - scale_percentile.map(value)
if width_scale:
percentile_lines[percentile] += f" {width_scale.map(bucket_data['pos_x']+bucket_width/2)},{pos_y/100 * height}"
percentile_lines[percentile] += f" {width_scale.map(bucket_data['pos_x'] + bucket_width / 2)},{pos_y / 100 * height}"

percentile = float(percentile)
pretty_percentile = int(percentile) if percentile.is_integer() else percentile
Expand Down
2 changes: 1 addition & 1 deletion tinygraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ def pretty_duration(duration_s: int):
elif duration_s < 24 * HOUR:
fmt = f"{duration_s // HOUR}h"
else:
fmt = f"{duration_s // (24*HOUR)}d"
fmt = f"{duration_s // (24 * HOUR)}d"
return fmt

0 comments on commit 136a859

Please sign in to comment.