Skip to content

Commit

Permalink
Merge pull request #46 from unicef/lint
Browse files Browse the repository at this point in the history
lint
  • Loading branch information
domdinicola authored May 9, 2024
2 parents ed2d2aa + 205a8f4 commit 9bb6cb2
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def strip_prefix(s):
yield f" return str(self.{attr})"
break

def normalize_col_name(self, col_name: str, used_column_names: List[str], is_relation: bool):
def normalize_col_name(self, col_name: str, used_column_names: List[str], is_relation: bool): # noqa
"""
Modify the column name to make it Python-compatible as a field name
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def halt(self, e: Exception) -> None: # pragma: no cover

sys.exit(1)

def handle(self, *args: Any, **options: Any) -> None:
def handle(self, *args: Any, **options: Any) -> None: # noqa
from hope_country_report.apps.core.models import CountryOffice, User

self.get_options(options)
Expand Down
4 changes: 2 additions & 2 deletions src/hope_country_report/apps/hope/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def register_all_app_models() -> None:


if not state.inspecting: # pragma: no branch
from .generic import *
from .utils import modeladmin_factory
from .generic import * # noqa
from .utils import modeladmin_factory # noqa

register_all_app_models()
2 changes: 1 addition & 1 deletion src/hope_country_report/apps/hope/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from ._inspect import *
from ._inspect import * # noqa
1 change: 0 additions & 1 deletion src/hope_country_report/apps/hope/patcher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from django.apps import AppConfig, apps
from django.db import models
from django.db.models import Model
from django.utils.functional import cached_property

from hope_country_report.apps.hope import models as hope_models
from hope_country_report.apps.hope.models import HopeModel
Expand Down
18 changes: 9 additions & 9 deletions src/hope_country_report/apps/power_query/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ._base import CeleryEnabled
from .arguments import Parametrizer
from .chart import ChartPage
from .dataset import Dataset
from .formatter import Formatter
from .query import Query
from .report import ReportConfiguration
from .report_document import ReportDocument
from .report_template import ReportTemplate
from ._base import CeleryEnabled # noqa
from .arguments import Parametrizer # noqa
from .chart import ChartPage # noqa
from .dataset import Dataset # noqa
from .formatter import Formatter # noqa
from .query import Query # noqa
from .report import ReportConfiguration # noqa
from .report_document import ReportDocument # noqa
from .report_template import ReportTemplate # noqa
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def filename(self):
@classmethod
def process(
self, report: "ReportConfiguration", dataset: "Dataset", formatter: "Formatter", notify: bool = True
) -> "Tuple[int|None, Exception|str]":
) -> "Tuple[int|None, Exception|str]": # noqa
try:
args_desc = "_".join([str(value) for value in dataset.arguments.values()])
context = {
Expand Down
2 changes: 1 addition & 1 deletion src/hope_country_report/apps/power_query/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from strategy_field.registry import Registry
from strategy_field.utils import fqn

from hope_country_report.apps.power_query.storage import DataSetStorage, HopeStorage
from hope_country_report.apps.power_query.storage import HopeStorage

from .utils import to_dataset

Expand Down
5 changes: 2 additions & 3 deletions src/hope_country_report/apps/power_query/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict, TYPE_CHECKING, Union
from typing import Any, Dict, TYPE_CHECKING

import base64
import binascii
Expand All @@ -16,7 +16,6 @@
from django.http import HttpRequest, HttpResponse
from django.utils.safestring import mark_safe

import pytz
import tablib
from constance import config
from sentry_sdk import configure_scope
Expand Down Expand Up @@ -44,7 +43,7 @@ def make_naive(value: datetime.datetime) -> datetime.datetime:
return value


def to_dataset(result: "QuerySet[AnyModel]|Iterable[Any]|tablib.Dataset|Dict[str,Any]") -> tablib.Dataset:
def to_dataset(result: "QuerySet[AnyModel]|Iterable[Any]|tablib.Dataset|Dict[str,Any]") -> tablib.Dataset: # noqa
if isinstance(result, QuerySet):
data = tablib.Dataset()
fields = result.__dict__["_fields"]
Expand Down
10 changes: 5 additions & 5 deletions src/hope_country_report/web/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from .charts import ChartDetailView, ChartListView
from .document import (
from .charts import ChartDetailView, ChartListView # noqa
from .document import ( # noqa
OfficeDocumentDisplayView,
OfficeDocumentDownloadView,
OfficeReportDocumentDetailView,
OfficeReportDocumentListView,
RequestAccessView,
)
from .generic import (
from .generic import ( # noqa
download,
index,
OfficeHomeView,
Expand All @@ -15,5 +15,5 @@
OfficePreferencesView,
select_tenant,
)
from .report import OfficeConfigurationDetailView, OfficeConfigurationListView
from .user import UserProfileView
from .report import OfficeConfigurationDetailView, OfficeConfigurationListView # noqa
from .user import UserProfileView # noqa
2 changes: 1 addition & 1 deletion tests/power_query/test_pq_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def query(data: "_DATA"):

@pytest.fixture()
def query_impl(data: "_DATA", query):
from testutils.factories import ContentTypeFactory, QueryFactory
from testutils.factories import QueryFactory

return QueryFactory(
target=None,
Expand Down

0 comments on commit 9bb6cb2

Please sign in to comment.