Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pinecone/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
from .openapi_configuration import Configuration as OpenApiConfiguration
from .pinecone_config import PineconeConfig

__all__ = [
"ConfigBuilder",
"Config",
"OpenApiConfiguration",
"PineconeConfig",
]

if os.getenv("PINECONE_DEBUG") is not None:
logging.getLogger("pinecone").setLevel(level=logging.DEBUG)
31 changes: 31 additions & 0 deletions pinecone/db_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,35 @@
from .db_control_asyncio import DBControlAsyncio
from .repr_overrides import install_repr_overrides

__all__ = [
# from .enums
"CloudProvider",
"AwsRegion",
"GcpRegion",
"AzureRegion",
"DeletionProtection",
"Metric",
"PodIndexEnvironment",
"PodType",
"VectorType",
# from .models
"CollectionDescription",
"PodSpec",
"PodSpecDefinition",
"ServerlessSpec",
"ServerlessSpecDefinition",
"ByocSpec",
"IndexList",
"CollectionList",
"IndexModel",
"IndexEmbed",
"BackupModel",
"BackupList",
"RestoreJobModel",
"RestoreJobList",
# direct imports
"DBControl",
"DBControlAsyncio",
]

install_repr_overrides()
2 changes: 2 additions & 0 deletions pinecone/db_control/resources/asyncio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .index import IndexResourceAsyncio
from .collection import CollectionResourceAsyncio

__all__ = ["IndexResourceAsyncio", "CollectionResourceAsyncio"]
2 changes: 2 additions & 0 deletions pinecone/db_control/resources/sync/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .index import IndexResource
from .collection import CollectionResource

__all__ = ["IndexResource", "CollectionResource"]
2 changes: 2 additions & 0 deletions pinecone/db_control/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .create_index_for_model_embed import CreateIndexForModelEmbedTypedDict

__all__ = ["CreateIndexForModelEmbedTypedDict"]
33 changes: 29 additions & 4 deletions pinecone/db_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@

from .resources.sync.bulk_import import ImportErrorMode

__all__ = [
"_Index",
"_IndexAsyncio",
"DescribeIndexStatsResponse",
"FetchResponse",
"ImportErrorMode",
"Index",
"IndexClientInstantiationError",
"Inference",
"InferenceInstantiationError",
"MetadataDictionaryExpectedError",
"QueryResponse",
"SearchQuery",
"SearchQueryVector",
"SearchRerank",
"SparseValues",
"SparseValuesDictionaryExpectedError",
"SparseValuesMissingKeysError",
"SparseValuesTypeError",
"UpsertResponse",
"Vector",
"VectorDictionaryExcessKeysError",
"VectorDictionaryMissingKeysError",
"VectorTupleLengthError",
]

import warnings

Expand All @@ -41,10 +66,10 @@ def _get_deprecated_import(name, from_module, to_module):
)
# Import from the new location
from pinecone.inference import (
Inference as _Inference,
AsyncioInference as _AsyncioInference,
RerankModel,
EmbedModel,
Inference as _Inference, # noqa: F401
AsyncioInference as _AsyncioInference, # noqa: F401
RerankModel, # noqa: F401
EmbedModel, # noqa: F401
)

return locals()[name]
Expand Down
9 changes: 9 additions & 0 deletions pinecone/db_data/dataclasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
from .search_query import SearchQuery
from .search_query_vector import SearchQueryVector
from .search_rerank import SearchRerank

__all__ = [
"SparseValues",
"Vector",
"FetchResponse",
"SearchQuery",
"SearchQueryVector",
"SearchRerank",
]
13 changes: 13 additions & 0 deletions pinecone/db_data/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@
from .search_rerank_typed_dict import SearchRerankTypedDict
from .search_query_typed_dict import SearchQueryTypedDict
from .search_query_vector_typed_dict import SearchQueryVectorTypedDict

__all__ = [
"SparseVectorTypedDict",
"VectorTypedDict",
"VectorMetadataTypedDict",
"VectorTuple",
"VectorTupleWithMetadata",
"FilterTypedDict",
"SearchRerankTypedDict",
"SearchQueryTypedDict",
"SearchQueryVectorTypedDict",
]

11 changes: 11 additions & 0 deletions pinecone/inference/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@
from .inference_request_builder import RerankModel, EmbedModel
from .models import ModelInfo, ModelInfoList, EmbeddingsList, RerankResult

__all__ = [
"Inference",
"AsyncioInference",
"RerankModel",
"EmbedModel",
"ModelInfo",
"ModelInfoList",
"EmbeddingsList",
"RerankResult",
]

install_repl_overrides()
42 changes: 42 additions & 0 deletions pinecone/openapi_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,45 @@

from .types import PropertyValidationTypedDict
from .cached_class_property import cached_class_property

__all__ = [
"ApiClient",
"Endpoint",
"ExtraOpenApiKwargsTypedDict",
"KwargsWithOpenApiKwargDefaultsTypedDict",
"AsyncioApiClient",
"AsyncioEndpoint",
"Configuration",
"PineconeException",
"PineconeApiAttributeError",
"PineconeApiTypeError",
"PineconeApiValueError",
"PineconeApiKeyError",
"PineconeApiException",
"NotFoundException",
"UnauthorizedException",
"ForbiddenException",
"ServiceException",
"OpenApiModel",
"ModelNormal",
"ModelSimple",
"ModelComposed",
"change_keys_js_to_python",
"convert_js_args_to_python_args",
"validate_get_composed_info",
"cached_property",
"validate_and_convert_types",
"check_allowed_values",
"check_validations",
"file_type",
"none_type",
"Urllib3RestClient",
"AiohttpRestClient",
"RESTResponse",
"OPENAPI_ENDPOINT_PARAMS",
"date",
"datetime",
"parse",
"PropertyValidationTypedDict",
"cached_class_property",
]
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ docstring-code-line-length = "dynamic"

[tool.ruff.lint.per-file-ignores]
# F403 Allow star imports
# F401 allow imported but unused
"__init__.py" = ["F401", "F403", "F405"]
"__init__.py" = ["F403", "F405"]

# E402 Allow module level import not at top of file so
# tqdm warnings can be disabled ahead of loading any code
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@
delete_indexes_from_run,
default_create_index_params,
)

__all__ = [
"fake_api_key",
"get_environment_var",
"random_string",
"generate_index_name",
"generate_collection_name",
"poll_stats_for_namespace",
"poll_fetch_for_ids_in_namespace",
"embedding_values",
"jsonprint",
"index_tags",
"delete_backups_from_run",
"delete_indexes_from_run",
"default_create_index_params",
]