Skip to content

Commit cc50701

Browse files
committed
create ability to delete attachment via attachment id
1 parent 6512fdd commit cc50701

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

labelbox/schema/data_row.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,11 @@ def create_attachment(self, attachment_type,
9696
})
9797
return Entity.AssetAttachment(self.client,
9898
res["createDataRowAttachment"])
99+
100+
def delete_attachment(self, attachment_id: str) -> None:
101+
"""Deletes an attachment on the data row."""
102+
query_str = """mutation deleteDataRowAttachmentPyApi($attachment_id: ID!) {
103+
deleteDataRowAttachment(where: {id: $attachment_id}) {
104+
id}
105+
}"""
106+
self.client.execute(query_str, {"attachment_id": attachment_id})

0 commit comments

Comments
 (0)