We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc10c1d commit 0b19fcaCopy full SHA for 0b19fca
learn/experimental/merge-namespaces/merge-namespaces.ipynb
@@ -75,7 +75,13 @@
75
"dimension = index.describe_index_stats()['dimension']\n",
76
"# Function to fetch all vectors from a namespace\n",
77
"def fetch_all_vectors(namespace):\n",
78
- " count = index.describe_index_stats()['namespaces'][namespace]['vector_count']\n",
+ " try:\n",
79
+ " count = index.describe_index_stats()['namespaces'][namespace]['vector_count']\n",
80
+ " if count > 10000:\n",
81
+ " raise ValueError(\"Namespaces larger than 10000 vectors need to be handled iteratively.\")\n",
82
+ " except ValueError as e:\n",
83
+ " print(f\"Error: {e}\")\n",
84
+ " return []\n",
85
" random_vecs = [random.random() for _ in range(dimension)]\n",
86
" response = index.query(\n",
87
" namespace=namespace,\n",
0 commit comments