Skip to content

Commit

Permalink
Merge pull request #393 from aiven/hacka-fix-linting-issues
Browse files Browse the repository at this point in the history
Fix linting issues
  • Loading branch information
tvainika authored Apr 12, 2022
2 parents 52e3025 + 49943dd commit 55956a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ repos:
- id: mypy
name: Mypy Karapace
pass_filenames: false
args: ["--ignore-missing-imports", "--package", "karapace"]
args:
- "--show-error-codes"
- "--ignore-missing-imports"
- "--package"
- "karapace"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
Expand Down
2 changes: 1 addition & 1 deletion karapace/anonymize_schemas/anonymize_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ def anonymize(input_schema: Schema) -> Schema:
output_schema[key] = anonymize(value)
return output_schema
else:
return input_schema
return input_schema # type: ignore[unreachable]
6 changes: 3 additions & 3 deletions tests/integration/test_schema_backup_avro_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
Copyright (c) 2019 Aiven Ltd
See LICENSE for details
"""
from karapace.client import Client
from karapace.config import set_config_defaults
from karapace.schema_backup import SchemaBackup
from karapace.utils import Client
from pathlib import Path
from tests.utils import KafkaServers
from tests.integration.utils.kafka_server import KafkaServers
from typing import Any, Dict

import os
Expand Down Expand Up @@ -58,7 +58,7 @@ async def insert_data(c: Client, schemaType: str, subject: str, data: Dict[str,
"subjects/{}/versions".format(subject),
json={"schema": f"{schema_string}", "schemaType": schemaType},
)
assert res.status == 200
assert res.status_code == 200
assert "id" in res.json()


Expand Down
23 changes: 12 additions & 11 deletions tests/unit/anonymize_schemas/test_anonymize_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
PRIMITIVE_TYPE_SCHEMA = json.loads('"int"')
EXPECTED_PRIMITIVE_TYPE_SCHEMA = "int"


# Pylint issue: https://github.com/PyCQA/pylint/issues/3368
# pylint: disable=line-too-long
SCHEMA_WITH_NAME = json.loads('"io.aiven.myrecord"')
EXPECTED_SCHEMA_WITH_NAME = "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.afe8733e983101f1f4ff50d24152890d0da71418" # pylint: disable=line-too-long
EXPECTED_SCHEMA_WITH_NAME = "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.afe8733e983101f1f4ff50d24152890d0da71418"


FIXED_VALUE_SCHEMA_INVALID = json.loads("100.101")
Expand Down Expand Up @@ -212,7 +213,7 @@
"namespace": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382",
"name": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3.a09a23220f2c3d64d1e1d6d18c4d5280f8d82fca",
"aliases": [
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a99e5e92725f9873fa5802326346a6067051ee61", # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a99e5e92725f9873fa5802326346a6067051ee61",
"a99e5e92725f9873fa5802326346a6067051ee61",
],
"fields": [
Expand All @@ -235,24 +236,24 @@
"name": "abe0d2dc12d0aa622bacbe23b5516c2e7895e1d7",
"namespace": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382",
"aliases": [
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.afaba999b462193044dfff2af00fd144e3622c93" # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.afaba999b462193044dfff2af00fd144e3622c93"
],
"symbols": ["a58b5a8ced9db48b30e008b148004c1065ce53b1", "a6e018ece5a1d3b750531de58d16b961de23d629"],
"default": "a6e018ece5a1d3b750531de58d16b961de23d629",
},
{
"type": "array",
"name": "af227bcd25744bf96408ccc655a37521935c7ab1",
"items": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a94a8fe5ccb19ba61c4c0873d391e987982fbbd3.a09a23220f2c3d64d1e1d6d18c4d5280f8d82fca", # pylint: disable=line-too-long
"items": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a94a8fe5ccb19ba61c4c0873d391e987982fbbd3.a09a23220f2c3d64d1e1d6d18c4d5280f8d82fca",
"default": [],
"a43c4b82570e182eb1c74072896167113d2c7345": "a0f1005a1091064f11247324586b3fe8b4504e26.aa39a3ee5e6b4b0d3255bfef95601890afd80709", # pylint: disable=line-too-long
"a43c4b82570e182eb1c74072896167113d2c7345": "a0f1005a1091064f11247324586b3fe8b4504e26.aa39a3ee5e6b4b0d3255bfef95601890afd80709",
},
{
"type": "array",
"name": "ab840f929bee7c863e52894210d3916a03226427",
"items": [
"string",
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.ac8fb489b3e9ff687f990ffb2b2f1ec08b0052ca", # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.ac8fb489b3e9ff687f990ffb2b2f1ec08b0052ca",
],
"default": [],
},
Expand All @@ -265,7 +266,7 @@
{
"type": [
"null",
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a94a8fe5ccb19ba61c4c0873d391e987982fbbd3.a09a23220f2c3d64d1e1d6d18c4d5280f8d82fca", # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a94a8fe5ccb19ba61c4c0873d391e987982fbbd3.a09a23220f2c3d64d1e1d6d18c4d5280f8d82fca",
],
"name": "ae69f15f11172a41f77b4a0aa0b7a60906eecb3c",
},
Expand All @@ -274,7 +275,7 @@
"name": "ab98f5b85764b8561cacbb055a963cd334928cba",
"namespace": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382",
"aliases": [
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a6e4c69f975b291f655e5eaa65ed9eb97781cb01" # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a6e4c69f975b291f655e5eaa65ed9eb97781cb01"
],
"order": "ae5d03fc0f0537f32701e8cab51a448a0f591d97",
"size": 16,
Expand Down Expand Up @@ -426,7 +427,7 @@
"namespace": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382",
"name": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3.a09a23220f2c3d64d1e1d6d18c4d5280f8d82fca",
"aliases": [
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a99e5e92725f9873fa5802326346a6067051ee61", # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.a99e5e92725f9873fa5802326346a6067051ee61",
"a99e5e92725f9873fa5802326346a6067051ee61",
],
"fields": [
Expand All @@ -447,7 +448,7 @@
"name": "abe0d2dc12d0aa622bacbe23b5516c2e7895e1d7",
"namespace": "aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382",
"aliases": [
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.afaba999b462193044dfff2af00fd144e3622c93", # pylint: disable=line-too-long
"aa258230180d9c643f761089d7e33b8b52288ed3.ae02f26b082c5f3bc7027f72335dd1186a2cd382.afaba999b462193044dfff2af00fd144e3622c93",
],
"symbols": ["a58b5a8ced9db48b30e008b148004c1065ce53b1", "a6e018ece5a1d3b750531de58d16b961de23d629"],
"default": "a6e018ece5a1d3b750531de58d16b961de23d629",
Expand Down

0 comments on commit 55956a9

Please sign in to comment.