Skip to content

Commit 0c91e8b

Browse files
committed
update
1 parent 697a9cb commit 0c91e8b

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

Quickstart-Document-Permissions/document-permissions.ipynb

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,15 @@
100100
},
101101
{
102102
"cell_type": "code",
103-
"execution_count": null,
103+
"execution_count": 15,
104104
"id": "2ce7eb5e",
105105
"metadata": {},
106106
"outputs": [
107107
{
108-
"ename": "HttpResponseError",
109-
"evalue": "() Field mapping specifies target field 'metadata_group_ids' that is not present in the target index\nCode: \nMessage: Field mapping specifies target field 'metadata_group_ids' that is not present in the target index",
110-
"output_type": "error",
111-
"traceback": [
112-
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
113-
"\u001b[31mHttpResponseError\u001b[39m Traceback (most recent call last)",
114-
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[14]\u001b[39m\u001b[32m, line 13\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mazure\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01msearch\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mdocuments\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mindexes\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mmodels\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m SearchIndexer, FieldMapping\n\u001b[32m 3\u001b[39m indexer = SearchIndexer(\n\u001b[32m 4\u001b[39m name=indexer_name,\n\u001b[32m 5\u001b[39m target_index_name=index_name,\n\u001b[32m (...)\u001b[39m\u001b[32m 10\u001b[39m ]\n\u001b[32m 11\u001b[39m )\n\u001b[32m---> \u001b[39m\u001b[32m13\u001b[39m \u001b[43mindexer_client\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcreate_or_update_indexer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mindexer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 14\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mIndexer \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mindexer_name\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m created\u001b[39m\u001b[33m\"\u001b[39m)\n",
115-
"\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\magottei\\source\\azure-search-python-samples-pr\\.venv\\Lib\\site-packages\\azure\\core\\tracing\\decorator.py:119\u001b[39m, in \u001b[36mdistributed_trace.<locals>.decorator.<locals>.wrapper_use_tracer\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 117\u001b[39m \u001b[38;5;66;03m# If tracing is disabled globally and user didn't explicitly enable it, don't trace.\u001b[39;00m\n\u001b[32m 118\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m user_enabled \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m (\u001b[38;5;129;01mnot\u001b[39;00m tracing_enabled \u001b[38;5;129;01mand\u001b[39;00m user_enabled \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[32m--> \u001b[39m\u001b[32m119\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 121\u001b[39m \u001b[38;5;66;03m# Merge span is parameter is set, but only if no explicit parent are passed\u001b[39;00m\n\u001b[32m 122\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m merge_span \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m passed_in_parent:\n",
116-
"\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\magottei\\source\\azure-search-python-samples-pr\\.venv\\Lib\\site-packages\\azure\\search\\documents\\indexes\\_search_indexer_client.py:140\u001b[39m, in \u001b[36mSearchIndexerClient.create_or_update_indexer\u001b[39m\u001b[34m(self, indexer, match_condition, skip_indexer_reset_requirement_for_cache, disable_cache_reprocessing_change_detection, **kwargs)\u001b[39m\n\u001b[32m 138\u001b[39m name = indexer.name\n\u001b[32m 139\u001b[39m patched_indexer = indexer._to_generated() \u001b[38;5;66;03m# pylint:disable=protected-access\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m140\u001b[39m result = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_client\u001b[49m\u001b[43m.\u001b[49m\u001b[43mindexers\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcreate_or_update\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 141\u001b[39m \u001b[43m \u001b[49m\u001b[43mindexer_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 142\u001b[39m \u001b[43m \u001b[49m\u001b[43mindexer\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpatched_indexer\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 143\u001b[39m \u001b[43m \u001b[49m\u001b[43mprefer\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mreturn=representation\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 144\u001b[39m \u001b[43m \u001b[49m\u001b[43merror_map\u001b[49m\u001b[43m=\u001b[49m\u001b[43merror_map\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 145\u001b[39m \u001b[43m \u001b[49m\u001b[43mskip_indexer_reset_requirement_for_cache\u001b[49m\u001b[43m=\u001b[49m\u001b[43mskip_indexer_reset_requirement_for_cache\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 146\u001b[39m \u001b[43m \u001b[49m\u001b[43mdisable_cache_reprocessing_change_detection\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdisable_cache_reprocessing_change_detection\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 147\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\n\u001b[32m 148\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 149\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m cast(SearchIndexer, SearchIndexer._from_generated(result))\n",
117-
"\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\magottei\\source\\azure-search-python-samples-pr\\.venv\\Lib\\site-packages\\azure\\core\\tracing\\decorator.py:119\u001b[39m, in \u001b[36mdistributed_trace.<locals>.decorator.<locals>.wrapper_use_tracer\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 117\u001b[39m \u001b[38;5;66;03m# If tracing is disabled globally and user didn't explicitly enable it, don't trace.\u001b[39;00m\n\u001b[32m 118\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m user_enabled \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m (\u001b[38;5;129;01mnot\u001b[39;00m tracing_enabled \u001b[38;5;129;01mand\u001b[39;00m user_enabled \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[32m--> \u001b[39m\u001b[32m119\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 121\u001b[39m \u001b[38;5;66;03m# Merge span is parameter is set, but only if no explicit parent are passed\u001b[39;00m\n\u001b[32m 122\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m merge_span \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m passed_in_parent:\n",
118-
"\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\magottei\\source\\azure-search-python-samples-pr\\.venv\\Lib\\site-packages\\azure\\search\\documents\\indexes\\_generated\\operations\\_indexers_operations.py:981\u001b[39m, in \u001b[36mIndexersOperations.create_or_update\u001b[39m\u001b[34m(self, indexer_name, prefer, indexer, if_match, if_none_match, skip_indexer_reset_requirement_for_cache, disable_cache_reprocessing_change_detection, request_options, **kwargs)\u001b[39m\n\u001b[32m 979\u001b[39m map_error(status_code=response.status_code, response=response, error_map=error_map)\n\u001b[32m 980\u001b[39m error = \u001b[38;5;28mself\u001b[39m._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)\n\u001b[32m--> \u001b[39m\u001b[32m981\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m HttpResponseError(response=response, model=error)\n\u001b[32m 983\u001b[39m deserialized = \u001b[38;5;28mself\u001b[39m._deserialize(\u001b[33m\"\u001b[39m\u001b[33mSearchIndexer\u001b[39m\u001b[33m\"\u001b[39m, pipeline_response.http_response)\n\u001b[32m 985\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m:\n",
119-
"\u001b[31mHttpResponseError\u001b[39m: () Field mapping specifies target field 'metadata_group_ids' that is not present in the target index\nCode: \nMessage: Field mapping specifies target field 'metadata_group_ids' that is not present in the target index"
108+
"name": "stdout",
109+
"output_type": "stream",
110+
"text": [
111+
"Indexer 'document-permissions-sample-indexer' created\n"
120112
]
121113
}
122114
],

0 commit comments

Comments
 (0)