Skip to content

Commit 9b5e3ae

Browse files
mdrxyfaxe1008
authored andcommitted
fix: lint (#405)
1 parent 50755ec commit 9b5e3ae

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

libs/community/langchain_community/document_loaders/rss.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,15 @@ def lazy_load(self) -> Iterator[Document]:
124124
)
125125
article = loader.load()[0]
126126
article.metadata["feed"] = url
127-
# If the publish date is not set by newspaper, try to extract it from the feed entry
127+
# If the publish date is not set by newspaper, try to extract it
128+
# from the feed entry
128129
if article.metadata.get("publish_date") is None:
129130
from datetime import datetime
131+
130132
publish_date = entry.get("published_parsed", None)
131-
article.metadata["publish_date"] = datetime(*publish_date[:6]) if publish_date else None
133+
article.metadata["publish_date"] = (
134+
datetime(*publish_date[:6]) if publish_date else None
135+
)
132136
yield article
133137
except Exception as e:
134138
if self.continue_on_failure:

libs/community/langchain_community/vectorstores/duckdb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import logging
66
import uuid
77
import warnings
8-
from typing import Any, Iterable, List, Optional, Type
8+
from typing import Any, Iterable, List, Optional, Type, cast
99

1010
from langchain_core.documents import Document
1111
from langchain_core.embeddings import Embeddings
@@ -224,12 +224,12 @@ def similarity_search_pd(
224224
list_cosine_similarity = self.duckdb.FunctionExpression(
225225
"list_cosine_similarity",
226226
self.duckdb.ColumnExpression(self._vector_key),
227-
self.duckdb.ConstantExpression(embedding),
227+
self.duckdb.ConstantExpression(cast(str, embedding)),
228228
)
229229
docs = (
230230
self._table.select(
231231
*[
232-
self.duckdb.StarExpression(exclude=[]),
232+
self.duckdb.StarExpression(),
233233
list_cosine_similarity.alias(SIMILARITY_ALIAS),
234234
]
235235
)
@@ -269,12 +269,12 @@ def similarity_search(
269269
list_cosine_similarity = self.duckdb.FunctionExpression(
270270
"list_cosine_similarity",
271271
self.duckdb.ColumnExpression(self._vector_key),
272-
self.duckdb.ConstantExpression(embedding),
272+
self.duckdb.ConstantExpression(cast(str, embedding)),
273273
)
274274
docs = (
275275
self._table.select(
276276
*[
277-
self.duckdb.StarExpression(exclude=[]),
277+
self.duckdb.StarExpression(),
278278
list_cosine_similarity.alias(SIMILARITY_ALIAS),
279279
]
280280
)

libs/community/tests/unit_tests/imports/test_langchain_proxy_imports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ def test_vectorstores() -> None:
2121
"ClickhouseSettings",
2222
"MyScaleSettings",
2323
"AzureCosmosDBVectorSearch",
24+
"Tigris", # Was removed upstream but haven't released yet
2425
]:
2526
assert issubclass(getattr(vectorstores, cls), VectorStore)

0 commit comments

Comments
 (0)