Skip to content

Commit

Permalink
fix: account for lists of items
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer Tran committed May 16, 2024
1 parent 2fa3197 commit c5a0031
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@
" item = json.load(file)\n",
"\n",
" # Publish the updated collection to the target ingestion `api/collections` endpoint\n",
" ingest_item(item)\n",
" if isinstance(item_json, list):\n",
" for single_item in item_json:\n",
" ingest_item(single_item)\n",
" else:\n",
" ingest_item(item)\n",
"\n",
" except requests.RequestException as e:\n",
" print(f\"An error occurred for collectionId {collection_id}: {e}\")\n",
Expand Down

0 comments on commit c5a0031

Please sign in to comment.