pinecone.control.repr_overrides
1from pinecone.utils import install_json_repr_override 2from pinecone.models.index_model import IndexModel 3from pinecone.core.openapi.control.models import CollectionModel 4 5 6def install_repr_overrides(): 7 """ 8 The generator code uses pprint.pformat to format the repr output 9 which looks really poor when printing a list of large objects 10 in a notebook setting. We override it here for a few select models 11 instead of modifying the generator code because the more compact output 12 from pprint.pformat seems better for data plane objects such as lists of 13 query results. 14 """ 15 for model in [IndexModel, CollectionModel]: 16 install_json_repr_override(model)
def
install_repr_overrides():
7def install_repr_overrides(): 8 """ 9 The generator code uses pprint.pformat to format the repr output 10 which looks really poor when printing a list of large objects 11 in a notebook setting. We override it here for a few select models 12 instead of modifying the generator code because the more compact output 13 from pprint.pformat seems better for data plane objects such as lists of 14 query results. 15 """ 16 for model in [IndexModel, CollectionModel]: 17 install_json_repr_override(model)
The generator code uses pprint.pformat to format the repr output which looks really poor when printing a list of large objects in a notebook setting. We override it here for a few select models instead of modifying the generator code because the more compact output from pprint.pformat seems better for data plane objects such as lists of query results.