File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
learn/experimental/merge-namespaces Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 75
75
" dimension = index.describe_index_stats()['dimension']\n " ,
76
76
" # Function to fetch all vectors from a namespace\n " ,
77
77
" def fetch_all_vectors(namespace):\n " ,
78
- " count = index.describe_index_stats()['namespaces'][namespace]['vector_count']\n " ,
78
+ " 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 " ,
79
85
" random_vecs = [random.random() for _ in range(dimension)]\n " ,
80
86
" response = index.query(\n " ,
81
87
" namespace=namespace,\n " ,
You can’t perform that action at this time.
0 commit comments