Skip to content

Commit

Permalink
Assert match is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Apr 4, 2024
1 parent 35cd5c2 commit 8d9f12a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/databricks/labs/ucx/installer/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def parse_logs(*log_paths: Path) -> Iterator[LogRecord]:
next_line = f.readline()
next_match = pattern.match(next_line)

assert match is not None
level, msg = match.groups()
log_record = LogRecord(logging.getLevelName(level), msg + multi_line_message)
yield log_record
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/installer/test_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"07:09 INFO [module] Other message.\n",
"07:09 WARNING [module] Warning message.\n",
"07:09 CRITICAL [module] Watch out!\n",
f"04:36 DEBUG [databricks.sdk] {MULTILINE_LOG_MESSAGE}"
f"04:36 DEBUG [databricks.sdk] {MULTILINE_LOG_MESSAGE}",
]
LOG_RECORDS = [
LogRecord(40, "Message."),
Expand Down

0 comments on commit 8d9f12a

Please sign in to comment.