@@ -219,7 +219,8 @@ class Meta:
219
219
220
220
def _get_chunked_blob (self , mode = None , prefetch = False , prefetch_to = None , delete = True ):
221
221
return ChunkedFileBlobIndexWrapper (
222
- self .FILE_BLOB_INDEX_MODEL .objects .filter (file = self )
222
+ # TODO: file blob inheritance hierarchy is unsound
223
+ self .FILE_BLOB_INDEX_MODEL .objects .filter (file = self ) # type: ignore[misc]
223
224
.select_related ("blob" )
224
225
.order_by ("offset" ),
225
226
mode = mode ,
@@ -295,7 +296,8 @@ def putfile(self, fileobj, blob_size=DEFAULT_BLOB_SIZE, commit=True, logger=noop
295
296
blob_fileobj = ContentFile (contents )
296
297
blob = self .FILE_BLOB_MODEL .from_file (blob_fileobj , logger = logger )
297
298
results .append (
298
- self .FILE_BLOB_INDEX_MODEL .objects .create (file = self , blob = blob , offset = offset )
299
+ # TODO: file blob inheritance hierarchy is unsound
300
+ self .FILE_BLOB_INDEX_MODEL .objects .create (file = self , blob = blob , offset = offset ) # type: ignore[misc]
299
301
)
300
302
offset += blob .size
301
303
self .size = offset
@@ -334,7 +336,8 @@ def assemble_from_file_blob_ids(self, file_blob_ids, checksum):
334
336
offset = 0
335
337
for blob in file_blobs :
336
338
try :
337
- self .FILE_BLOB_INDEX_MODEL .objects .create (file = self , blob = blob , offset = offset )
339
+ # TODO: file blob inheritance hierarchy is unsound
340
+ self .FILE_BLOB_INDEX_MODEL .objects .create (file = self , blob = blob , offset = offset ) # type: ignore[misc]
338
341
except IntegrityError :
339
342
# Most likely a `ForeignKeyViolation` like `SENTRY-11P5`, because
340
343
# the blob we want to link does not exist anymore
0 commit comments