Skip to content

Commit

Permalink
Running static checks
Browse files Browse the repository at this point in the history
  • Loading branch information
galvana committed Jan 11, 2025
1 parent 3e61c1f commit 00298a2
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"""

from alembic import op
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "1088e8353890"
Expand Down
5 changes: 2 additions & 3 deletions src/fides/api/api/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
from typing import Generator

from fastapi import Depends

from fides.services.messaging.messaging_service import MessagingService
from fides.services.privacy_request.privacy_request_service import PrivacyRequestService
from sqlalchemy.orm import Session

from fides.api.common_exceptions import FunctionalityNotConfigured
Expand All @@ -13,6 +10,8 @@
from fides.config import CONFIG, FidesConfig
from fides.config import get_config as get_app_config
from fides.config.config_proxy import ConfigProxy
from fides.services.messaging.messaging_service import MessagingService
from fides.services.privacy_request.privacy_request_service import PrivacyRequestService

_engine = None

Expand Down
8 changes: 4 additions & 4 deletions src/fides/api/api/v1/endpoints/drp_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from typing import Any, Dict, List, Optional

from fides.services.messaging.messaging_service import (
check_and_dispatch_error_notifications,
)
from fides.services.privacy_request.privacy_request_service import queue_privacy_request
import jwt
from fastapi import Depends, HTTPException, Security
from loguru import logger
Expand Down Expand Up @@ -47,6 +43,10 @@
from fides.common.api.v1 import urn_registry as urls
from fides.config import CONFIG
from fides.config.config_proxy import ConfigProxy
from fides.services.messaging.messaging_service import (
check_and_dispatch_error_notifications,
)
from fides.services.privacy_request.privacy_request_service import queue_privacy_request

router = APIRouter(tags=["DRP"], prefix=urls.V1_URL_PREFIX)

Expand Down
26 changes: 12 additions & 14 deletions src/fides/api/api/v1/endpoints/privacy_request_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
Union,
)

from fides.api.api.deps import get_privacy_request_service
from fides.services.messaging.messaging_service import (
check_and_dispatch_error_notifications,
send_verification_code_to_user,
)
from fides.services.privacy_request.privacy_request_service import (
PrivacyRequestService,
_trigger_pre_approval_webhooks,
queue_privacy_request,
)
import sqlalchemy
from fastapi import Body, Depends, HTTPException, Security
from fastapi.encoders import jsonable_encoder
Expand All @@ -52,6 +42,7 @@

from fides.api import common_exceptions
from fides.api.api import deps
from fides.api.api.deps import get_privacy_request_service
from fides.api.api.v1.endpoints.dataset_endpoints import _get_connection_config
from fides.api.api.v1.endpoints.manual_webhook_endpoints import (
get_access_manual_webhook_or_404,
Expand Down Expand Up @@ -101,9 +92,7 @@
)
from fides.api.schemas.dataset import CollectionAddressResponse, DryRunDatasetResponse
from fides.api.schemas.external_https import PrivacyRequestResumeFormat
from fides.api.schemas.messaging.messaging import (
MessagingActionType,
)
from fides.api.schemas.messaging.messaging import MessagingActionType
from fides.api.schemas.policy import ActionType
from fides.api.schemas.privacy_request import (
BulkPostPrivacyRequests,
Expand Down Expand Up @@ -171,6 +160,7 @@
PRIVACY_REQUEST_PRE_APPROVE_ELIGIBLE,
PRIVACY_REQUEST_PRE_APPROVE_NOT_ELIGIBLE,
PRIVACY_REQUEST_REQUEUE,
PRIVACY_REQUEST_RESUBMIT,
PRIVACY_REQUEST_RESUME,
PRIVACY_REQUEST_RESUME_FROM_REQUIRES_INPUT,
PRIVACY_REQUEST_RETRY,
Expand All @@ -184,10 +174,18 @@
REQUEST_TASK_CALLBACK,
REQUEST_TASKS,
V1_URL_PREFIX,
PRIVACY_REQUEST_RESUBMIT,
)
from fides.config import CONFIG
from fides.config.config_proxy import ConfigProxy
from fides.services.messaging.messaging_service import (
check_and_dispatch_error_notifications,
send_verification_code_to_user,
)
from fides.services.privacy_request.privacy_request_service import (
PrivacyRequestService,
_trigger_pre_approval_webhooks,
queue_privacy_request,
)

router = APIRouter(tags=["Privacy Requests"], prefix=V1_URL_PREFIX)

Expand Down
2 changes: 1 addition & 1 deletion src/fides/api/schemas/messaging/messaging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Type, Union, Set
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union

from fideslang.default_taxonomy import DEFAULT_TAXONOMY
from fideslang.validation import FidesKey
Expand Down
10 changes: 4 additions & 6 deletions src/fides/api/service/privacy_request/email_batch_service.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from enum import Enum

from fides.api.service.privacy_request.request_runner_service import (
get_consent_email_connection_configs,
get_erasure_email_connection_configs,
)
from loguru import logger
from sqlalchemy.orm import Query, Session

Expand All @@ -12,12 +8,14 @@
from fides.api.models.privacy_request import PrivacyRequest, PrivacyRequestStatus
from fides.api.schemas.policy import ActionType
from fides.api.service.connectors import get_connector
from fides.services.privacy_request.privacy_request_service import (
queue_privacy_request,
from fides.api.service.privacy_request.request_runner_service import (
get_consent_email_connection_configs,
get_erasure_email_connection_configs,
)
from fides.api.tasks import DatabaseTask, celery_app
from fides.api.tasks.scheduled.scheduler import scheduler
from fides.config import get_config
from fides.services.privacy_request.privacy_request_service import queue_privacy_request

CONFIG = get_config()
BATCH_EMAIL_SEND = "batch_email_send"
Expand Down
2 changes: 1 addition & 1 deletion src/fides/api/util/connection_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from fastapi import Depends, HTTPException
from fastapi.encoders import jsonable_encoder
from fides.services.privacy_request.privacy_request_service import queue_privacy_request
from fideslang.validation import FidesKey
from loguru import logger
from pydantic import Field, ValidationError
Expand Down Expand Up @@ -60,6 +59,7 @@
)
from fides.api.util.logger import Pii
from fides.common.api.v1.urn_registry import CONNECTION_TYPES, SAAS_CONFIG
from fides.services.privacy_request.privacy_request_service import queue_privacy_request

# pylint: disable=too-many-nested-blocks,too-many-branches,too-many-statements

Expand Down
6 changes: 4 additions & 2 deletions src/fides/services/privacy_request/privacy_request_service.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set

from fides.api.common_exceptions import (
IdentityNotFoundException,
MessageDispatchException,
Expand All @@ -16,8 +17,8 @@
PrivacyRequestNotifications,
PrivacyRequestSource,
PrivacyRequestStatus,
ProvidedIdentityType,
ProvidedIdentity,
ProvidedIdentityType,
RequestTask,
)
from fides.api.models.property import Property
Expand Down Expand Up @@ -62,8 +63,9 @@
from fides.services.privacy_request.privacy_request_review_service import (
PrivacyRequestReviewService,
)
from sqlalchemy.orm import Session

from loguru import logger
from sqlalchemy.orm import Session

OPTIONAL_FIELDS = [
"id",
Expand Down

0 comments on commit 00298a2

Please sign in to comment.