Skip to content

Commit

Permalink
fix mypy problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewprvrzv committed Nov 17, 2023
1 parent a23bd4c commit 86cc511
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adaptive_hockey_federation/core/user_card.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from datetime import date
from typing import Optional, Union
from typing import Union


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions adaptive_hockey_federation/parser/xlsx_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def xlsx_parser(path: str) -> list[BaseUserInfo]:
sheet_data = []
workbook = openpyxl.load_workbook(path)
sheet = workbook.active
header = [cell.value for cell in sheet[1]]
for row in sheet.iter_rows(min_row=2, values_only=True):
header = [cell.value for cell in sheet[1]] # type: ignore
for row in sheet.iter_rows(min_row=2, values_only=True): # type: ignore
sheet_data.append(dict(zip(header, row)))
for data in sheet_data:
if data.get('ФИО игрока') is not None:
player = BaseUserInfo(
team=data.get('Команда'),
name=data.get('ФИО игрока').split()[0],
surname=data.get('ФИО игрока').split()[1],
name=data.get('ФИО игрока').split()[0], # type: ignore
surname=data.get('ФИО игрока').split()[1], # type: ignore
date_of_birth=data.get('Дата рождения'),
player_number=data.get('Номер игрока'),
position=data.get('Позиция'),
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ namespace_packages = false
plugins = ["mypy_django_plugin.main"]
mypy_path = "./adaptive_hockey_federation"

[[tool.mypy.overrides]]
module = [
"adaptive_hockey_federation.core.user_card",
"adaptive_hockey_federation.parser.*",
]
ignore_missing_imports = true


[tool.django-stubs]
django_settings_module = "adaptive_hockey_federation.settings"
Expand Down

0 comments on commit 86cc511

Please sign in to comment.