Skip to content

Commit 91985dd

Browse files
committed
Fix imports removed by ruff
Also ignore UP038 based on mongodb/django-mongodb-backend#389
1 parent 76b2d90 commit 91985dd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libs/langchain-mongodb/langchain_mongodb/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626
import numpy as np
2727
from pymongo.driver_info import DriverInfo
2828

29+
# Don't break imports for modules that expect this function
30+
# to be in this module.
31+
from pymongo_search_utils import _append_client_metadata # noqa: F401
32+
2933
logger = logging.getLogger(__name__)
3034

3135
Matrix = Union[List[List[float]], List[np.ndarray], np.ndarray]
3236

3337
DRIVER_METADATA = DriverInfo(name="Langchain", version=version("langchain-mongodb"))
3438

35-
# Don't break imports for modules that expect this function
36-
# to be in this module.
37-
3839

3940
def cosine_similarity(X: Matrix, Y: Matrix) -> np.ndarray:
4041
"""Row-wise cosine similarity between two equal-width matrices."""

libs/langchain-mongodb/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ lint.select = [
7878
"B", # flake8-bugbear
7979
"I", # isort
8080
]
81-
lint.ignore = ["E501", "B008", "UP007", "UP006", "UP035"]
81+
lint.ignore = ["E501", "B008", "UP007", "UP006", "UP035", "UP038"]
8282

8383
[tool.coverage.run]
8484
omit = ["tests/*"]

0 commit comments

Comments
 (0)