Skip to content

Commit 8b3b46a

Browse files
authored
CL-733 Ingest document ID does not exist until ingest is completed (#11)
1 parent d35a64d commit 8b3b46a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/maptiler/cloud_cli/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class S3UploadResult:
4949
@dataclass
5050
class IngestResponse:
5151
id: UUID
52-
document_id: UUID
52+
document_id: Optional[UUID]
5353
state: str
5454
upload: Union[S3Upload, GoogleDriveUpload, None]
5555
errors: list[Error]
@@ -117,9 +117,13 @@ def ingest_response(self, data: dict) -> IngestResponse:
117117
else:
118118
errors = []
119119

120+
document_id = data.get("document_id")
121+
if document_id is not None:
122+
document_id = UUID(document_id)
123+
120124
return IngestResponse(
121125
id=UUID(data["id"]),
122-
document_id=UUID(data["document_id"]),
126+
document_id=document_id,
123127
state=data["state"],
124128
upload=upload,
125129
errors=errors,

0 commit comments

Comments
 (0)