mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-18 00:31:36 +02:00
* wip checkpointing/continue on failure more stuff for checkpointing Basic implementation FE stuff More checkpointing/failure handling rebase rebase initial scaffolding for IT IT to test checkpointing Cleanup cleanup Fix it Rebase Add todo Fix actions IT Test more Pagination + fixes + cleanup Fix IT networking fix it * rebase * Address misc comments * Address comments * Remove unused router * rebase * Fix mypy * Fixes * fix it * Fix tests * Add drop index * Add retries * reset lock timeout * Try hard drop of schema * Add timeout/retries to downgrade * rebase * test * test * test * Close all connections * test closing idle only * Fix it * fix * try using null pool * Test * fix * rebase * log * Fix * apply null pool * Fix other test * Fix quality checks * Test not using the fixture * Fix ordering * fix test * Change pooling behavior
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from onyx.db.models import IndexAttemptError
|
|
|
|
|
|
class IndexAttemptErrorPydantic(BaseModel):
|
|
id: int
|
|
connector_credential_pair_id: int
|
|
|
|
document_id: str | None
|
|
document_link: str | None
|
|
|
|
entity_id: str | None
|
|
failed_time_range_start: datetime | None
|
|
failed_time_range_end: datetime | None
|
|
|
|
failure_message: str
|
|
is_resolved: bool = False
|
|
|
|
time_created: datetime
|
|
|
|
index_attempt_id: int
|
|
|
|
@classmethod
|
|
def from_model(cls, model: IndexAttemptError) -> "IndexAttemptErrorPydantic":
|
|
return cls(
|
|
id=model.id,
|
|
connector_credential_pair_id=model.connector_credential_pair_id,
|
|
document_id=model.document_id,
|
|
document_link=model.document_link,
|
|
entity_id=model.entity_id,
|
|
failed_time_range_start=model.failed_time_range_start,
|
|
failed_time_range_end=model.failed_time_range_end,
|
|
failure_message=model.failure_message,
|
|
is_resolved=model.is_resolved,
|
|
time_created=model.time_created,
|
|
index_attempt_id=model.index_attempt_id,
|
|
)
|