Skip to content

Commit f4372f7

Browse files
committed
chore(repo): Linting
1 parent 9aba918 commit f4372f7

File tree

8 files changed

+10
-13
lines changed

8 files changed

+10
-13
lines changed

src/quartz_api/internal/backends/dummydb/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# ruff: noqa: S311
33

44
import datetime as dt
5-
from uuid import UUID
65
import math
76
import random
8-
from uuid import uuid4
7+
from uuid import UUID, uuid4
98

109
from typing_extensions import override
1110

src/quartz_api/internal/backends/quartzdb/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,12 @@ def check_user_has_access_to_site(
456456
) -> None:
457457
"""Checks if a user has access to a site."""
458458
user = get_user_by_email(session=session, email=email)
459-
site_uuids = [str(site.location_uuid) for site in user.location_group.locations]
459+
site_uuids = [site.location_uuid for site in user.location_group.locations]
460460

461461
if site_uuid not in site_uuids:
462462
raise HTTPException(
463463
status_code=403,
464464
detail=f"Forbidden. User ({email}) "
465-
f"does not have access to this site {str(site_uuid)}. "
466-
f"User has access to {site_uuids}",
465+
f"does not have access to this site {site_uuid!s}. "
466+
f"User has access to {[str(s) for s in site_uuids]}",
467467
)

src/quartz_api/internal/backends/quartzdb/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import datetime as dt
44
import logging
5+
from collections.abc import Generator
56

67
import pytest
78
from pvsite_datamodel.read.model import get_or_create_model
@@ -16,7 +17,6 @@
1617
from sqlalchemy import Engine, create_engine
1718
from sqlalchemy.orm import Session
1819
from testcontainers.postgres import PostgresContainer
19-
from collections.abc import Generator
2020

2121
log = logging.getLogger(__name__)
2222

src/quartz_api/internal/backends/quartzdb/test_quartzdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import logging
66

77
import pytest
8-
from pvsite_datamodel.sqlmodels import LocationSQL, GenerationSQL
98
from fastapi import HTTPException
9+
from pvsite_datamodel.sqlmodels import GenerationSQL, LocationSQL
1010
from sqlalchemy import Engine
1111
from sqlalchemy.orm import Session
1212

src/quartz_api/internal/middleware/auth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import jwt
77
from fastapi import Depends, HTTPException, Request
88
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
9-
from typing_extensions import override
109

1110
token_auth_scheme = HTTPBearer()
1211

src/quartz_api/internal/models/endpoint_types.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
import datetime as dt
44
from enum import Enum
5-
from typing import Literal
6-
from typing import Annotated
5+
from typing import Annotated, Literal
76
from uuid import UUID
87
from zoneinfo import ZoneInfo
9-
from fastapi import Depends
108

9+
from fastapi import Depends
1110
from pydantic import BaseModel, Field
1211

1312

src/quartz_api/internal/service/regions/_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
# NOTE: We should probably make this take a timezone argument.
11-
# This would mean changing the column names, so I'm leaving it for now,
11+
# This would mean changing the column names, so I'm leaving it for now,
1212
# as I don't know whether this would affect clients.
1313
def format_csv_and_created_time(
1414
values: list[PredictedPower],

src/quartz_api/internal/service/regions/test_resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import unittest
21
import datetime as dt
2+
import unittest
33

44
from quartz_api.internal.models import ActualPower
55

0 commit comments

Comments
 (0)