This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 17945fc5ed D401 fixes in Pinecone provider (#37270)
17945fc5ed is described below
commit 17945fc5edcec619ccde0fbab0d6fb8e0eb206cd
Author: Kalyan <[email protected]>
AuthorDate: Fri Feb 9 20:16:33 2024 +0530
D401 fixes in Pinecone provider (#37270)
---
airflow/providers/pinecone/hooks/pinecone.py | 14 +++++++-------
pyproject.toml | 1 -
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/airflow/providers/pinecone/hooks/pinecone.py
b/airflow/providers/pinecone/hooks/pinecone.py
index f15605556c..6a116250f4 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 @@ class PineconeHook(BaseHook):
@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 @@ class PineconeHook(BaseHook):
**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 @@ class PineconeHook(BaseHook):
@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 @@ class PineconeHook(BaseHook):
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 @@ class PineconeHook(BaseHook):
@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 @@ class PineconeHook(BaseHook):
**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 94d629db75..1856aac2a4 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"]