diff --git a/airflow/providers/pinecone/hooks/pinecone.py b/airflow/providers/pinecone/hooks/pinecone.py index f15605556cf87..6a116250f4922 100644 --- a/airflow/providers/pinecone/hooks/pinecone.py +++ b/airflow/providers/pinecone/hooks/pinecone.py @@ -45,7 +45,7 @@ class PineconeHook(BaseHook): @classmethod def get_connection_form_widgets(cls) -> dict[str, Any]: - """Returns connection widgets to add to connection form.""" + """Return connection widgets to add to connection form.""" from flask_appbuilder.fieldwidgets import BS3TextFieldWidget from flask_babel import lazy_gettext from wtforms import StringField @@ -60,7 +60,7 @@ def get_connection_form_widgets(cls) -> dict[str, Any]: @classmethod def get_ui_field_behaviour(cls) -> dict[str, Any]: - """Returns custom field behaviour.""" + """Return custom field behaviour.""" return { "hidden_fields": ["port", "schema"], "relabeling": {"login": "Pinecone Environment", "password": "Pinecone API key"}, @@ -108,7 +108,7 @@ def upsert( **kwargs: Any, ) -> UpsertResponse: """ - The upsert operation writes vectors into a namespace. + Write vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value. @@ -204,7 +204,7 @@ def delete_index(index_name: str, timeout: int | None = None) -> None: @staticmethod def configure_index(index_name: str, replicas: int | None = None, pod_type: str | None = "") -> None: """ - Changes current configuration of the index. + Change the current configuration of the index. :param index_name: The name of the index to configure. :param replicas: The new number of replicas. @@ -258,7 +258,7 @@ def query_vector( sparse_vector: SparseValues | dict[str, list[float] | list[int]] | None = None, ) -> QueryResponse: """ - The Query operation searches a namespace, using a query vector. + Search a namespace using query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. API reference: https://docs.pinecone.io/reference/query @@ -288,7 +288,7 @@ def query_vector( @staticmethod def _chunks(iterable: list[Any], batch_size: int = 100) -> Any: - """Helper function to break an iterable into chunks of size batch_size.""" + """Break an iterable into chunks of size batch_size.""" it = iter(iterable) chunk = tuple(itertools.islice(it, batch_size)) while chunk: @@ -329,7 +329,7 @@ def describe_index_stats( **kwargs: Any, ) -> DescribeIndexStatsResponse: """ - Describes the index statistics. + Describe the index statistics. Returns statistics about the index's contents. For example: The vector count per namespace and the number of dimensions. diff --git a/pyproject.toml b/pyproject.toml index 94d629db75896..1856aac2a4f34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1546,7 +1546,6 @@ combine-as-imports = true "airflow/providers/pagerduty/hooks/pagerduty.py" = ["D401"] "airflow/providers/pagerduty/hooks/pagerduty_events.py" = ["D401"] "airflow/providers/papermill/hooks/kernel.py" = ["D401"] -"airflow/providers/pinecone/hooks/pinecone.py" = ["D401"] "airflow/providers/postgres/hooks/postgres.py" = ["D401"] "airflow/providers/presto/hooks/presto.py" = ["D401"] "airflow/providers/qdrant/hooks/qdrant.py" = ["D401"]