Skip to content

Commit fbc7a0c

Browse files
committed
Switch between legacy file_id and file_ids field when updating blocks
1 parent 3c1521a commit fbc7a0c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/datalab_api/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ def _update_data_block(
424424

425425
if file_ids:
426426
if len(file_ids) > 1:
427-
raise RuntimeError(
428-
"API does not currently support attaching multiple files in a block."
429-
)
430-
block_data["file_id"] = file_ids[0]
427+
block_data["file_ids"] = file_ids
428+
else:
429+
block_data.pop("file_ids", None)
430+
block_data["file_id"] = file_ids[0]
431431

432432
blocks_url = f"{self.datalab_api_url}/update-block/"
433433
payload = {

0 commit comments

Comments
 (0)