Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed May 29, 2024
1 parent 706e183 commit 030f238
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
ignore_missing_imports = True
17 changes: 8 additions & 9 deletions pyseed/seed_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
See also https://github.com/seed-platform/py-seed/main/LICENSE
"""

# Imports from Standard Library
from typing import Any, Dict, List, Optional, Set, Tuple, Union

# Imports from Third Party Modules
import json
import logging
import openpyxl
import os
import time
from collections import Counter
from csv import DictReader
from datetime import date
from pathlib import Path
from urllib.parse import _NetlocResultMixinStr
from typing import Any, Dict, List, Optional, Union

from openpyxl import Workbook

# Local Imports
from pyseed.seed_client_base import SEEDReadWriteClient
Expand Down Expand Up @@ -1347,7 +1344,7 @@ def download_pm_report(self, pm_username: str, pm_password: str, pm_template: Di
properties = response["properties"]

# Create an XLSX workbook object.
workbook = openpyxl.Workbook()
workbook = Workbook()

# Create a sheet object in the workbook.
sheet = workbook.active
Expand All @@ -1360,14 +1357,16 @@ def download_pm_report(self, pm_username: str, pm_password: str, pm_template: Di
header_row.append(key)

# Write the header row to the sheet object.
sheet.append(header_row)
if sheet:
sheet.append(header_row)

# Loop over the list of dictionaries and write the data to the sheet object.
for property in properties:
row = []
for key in header_row:
row.append(property[key])
sheet.append(row)
if sheet:
sheet.append(row)

# Report Template name
report_template_name = pm_template['name']
Expand Down
4 changes: 1 addition & 3 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
-r requirements.txt
flake8==4.0.1
mock==4.0.3
mypy==0.910
openpyxl==3.1.2
openpyxl-stubs>=0.1.24
mypy==1.10.0
pre-commit==2.19.0
pytest==7.1.2
pytest-cov==3.0.0
Expand Down

0 comments on commit 030f238

Please sign in to comment.