Skip to content

Commit

Permalink
Small #395 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Oct 5, 2023
1 parent 6dd3ae5 commit 0ce990b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clickhouse_driver/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
'Test',
)

num_priorities = len(log_priorities)


def log_block(block):
if block is None:
Expand All @@ -27,7 +29,7 @@ def log_block(block):
for row in block.get_rows():
row = dict(zip(column_names, row))

if 1 <= row['priority'] <= 9:
if 1 <= row['priority'] <= num_priorities:
priority = log_priorities[row['priority']]
else:
priority = row[0]
Expand Down

0 comments on commit 0ce990b

Please sign in to comment.