Skip to content

Commit

Permalink
Fix typing of protobuf/exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tvainika committed Jun 12, 2023
1 parent e038fce commit 4d4ece2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 8 additions & 1 deletion karapace/protobuf/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
Copyright (c) 2023 Aiven Ltd
See LICENSE for details
"""
from __future__ import annotations

from typing import TYPE_CHECKING

import json

if TYPE_CHECKING:
from karapace.protobuf.schema import ProtobufSchema


class IllegalStateException(Exception):
pass
Expand Down Expand Up @@ -38,7 +45,7 @@ def pretty_print_json(obj: str) -> str:


class ProtobufSchemaResolutionException(ProtobufException):
def __init__(self, fail_msg: str, writer_schema=None, reader_schema=None) -> None:
def __init__(self, fail_msg: str, writer_schema: ProtobufSchema, reader_schema: ProtobufSchema) -> None:
writer_dump = pretty_print_json(str(writer_schema))
reader_dump = pretty_print_json(str(reader_schema))
if writer_schema:
Expand Down
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ ignore_errors = True
[mypy-karapace.protobuf.protobuf_to_dict]
ignore_errors = True

[mypy-karapace.protobuf.exception]
ignore_errors = True

[mypy-karapace.protobuf.option_reader]
ignore_errors = True

Expand Down

0 comments on commit 4d4ece2

Please sign in to comment.