feat: add resumable dataset uploads
This commit is contained in:
parent
f8ed08b854
commit
8d40cff227
23 changed files with 913 additions and 21 deletions
|
|
@ -104,6 +104,22 @@ class ActionEvent(Base):
|
|||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class ImportJob(Base):
|
||||
"""Server-side dataset import (e.g. 3GB zip): polled by the UI/admin."""
|
||||
__tablename__ = "imports"
|
||||
id: Mapped[str] = mapped_column(String(32), primary_key=True, default=_uid)
|
||||
project_id: Mapped[str] = mapped_column(String(32), index=True)
|
||||
kind: Mapped[str] = mapped_column(String(32), default="zip-coco")
|
||||
status: Mapped[str] = mapped_column(String(32), default="queued", index=True)
|
||||
source: Mapped[str] = mapped_column(String(1024), default="")
|
||||
total_files: Mapped[int] = mapped_column(Integer, default=0)
|
||||
done_files: Mapped[int] = mapped_column(Integer, default=0)
|
||||
saved_annotations: Mapped[int] = mapped_column(Integer, default=0)
|
||||
error: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
|
||||
|
||||
class ExportJob(Base):
|
||||
__tablename__ = "exports"
|
||||
id: Mapped[str] = mapped_column(String(32), primary_key=True, default=_uid)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue