Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def upgrade() -> None:
def downgrade() -> None:
op.drop_table('url_checked_for_duplicate')

# Delete tasks of type "Duplicate Detection"
op.execute("DELETE FROM TASKS WHERE TASK_TYPE = 'Duplicate Detection';")

switch_enum_type(
table_name='tasks',
column_name='task_type',
Expand Down
3 changes: 1 addition & 2 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
from contextlib import asynccontextmanager

import aiohttp
Expand Down Expand Up @@ -28,7 +27,7 @@
from html_tag_collector.RootURLCache import RootURLCache
from html_tag_collector.URLRequestInterface import URLRequestInterface
from hugging_face.HuggingFaceInterface import HuggingFaceInterface
from pdap_api_client.AccessManager import AccessManager
from pdap_access_manager import AccessManager
from pdap_api_client.PDAPClient import PDAPClient
from util.DiscordNotifier import DiscordPoster

Expand Down
159 changes: 0 additions & 159 deletions pdap_api_client/AccessManager.py

This file was deleted.

47 changes: 0 additions & 47 deletions pdap_api_client/DTOs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from enum import Enum
from http import HTTPStatus
from typing import Optional, List

from pydantic import BaseModel
Expand All @@ -20,57 +19,11 @@ class ApprovalStatus(Enum):
PENDING = "pending"
NEEDS_IDENTIFICATION = "needs identification"



class UniqueURLDuplicateInfo(BaseModel):
original_url: str
approval_status: ApprovalStatus
rejection_note: Optional[str] = None

class UniqueURLResponseInfo(BaseModel):
is_unique: bool
duplicates: list[UniqueURLDuplicateInfo]


class Namespaces(Enum):
AUTH = "auth"
MATCH = "match"
CHECK = "check"
DATA_SOURCES = "data-sources"
SOURCE_COLLECTOR = "source-collector"


class RequestType(Enum):
POST = "POST"
PUT = "PUT"
GET = "GET"
DELETE = "DELETE"


class RequestInfo(BaseModel):
type_: RequestType
url: str
json: Optional[dict] = None
headers: Optional[dict] = None
params: Optional[dict] = None
timeout: Optional[int] = 10

def kwargs(self) -> dict:
d = {
"url": self.url,
}
if self.json is not None:
d['json'] = self.json
if self.headers is not None:
d['headers'] = self.headers
return d


class ResponseInfo(BaseModel):
status_code: HTTPStatus
data: Optional[dict]


class MatchAgencyResponse(BaseModel):
status: MatchAgencyResponseStatus
matches: List[MatchAgencyInfo]
Loading