Skip to content

Commit

Permalink
add unasync to project dependencies (#56)
Browse files Browse the repository at this point in the history
* add unasync and isort to project dependencies

* replace isort with ruff

* update poetry.lock

* revert elasticsearch client to 8.15.1 for now
  • Loading branch information
miguelgrinberg authored Dec 11, 2024
1 parent 686575c commit 9a17eb5
Show file tree
Hide file tree
Showing 6 changed files with 1,190 additions and 835 deletions.
2,004 changes: 1,173 additions & 831 deletions libs/elasticsearch/poetry.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions libs/elasticsearch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ optional = true

[tool.poetry.group.test_integration.dependencies]

[tool.poetry.group.codegen.dependencies]
unasync = "^0.6.0"

[tool.ruff]
select = [
Expand Down
2 changes: 1 addition & 1 deletion libs/elasticsearch/scripts/run_unasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def main(check=False):
for dir in source_dirs:
output_dir = f"{dir[0]}_sync_check/" if check else dir[1]
subprocess.check_call(["ruff", "format", "--target-version=py38", output_dir])
subprocess.check_call(["isort", output_dir])
subprocess.check_call(["ruff", "check", "--fix", "--select", "I", output_dir])
for file in glob("*.py", root_dir=dir[0]):
subprocess.check_call(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
from typing import Any, Dict, List, Optional

from elastic_transport import Transport
from elasticsearch import BadRequestError, ConflictError, Elasticsearch, NotFoundError
from elasticsearch import (
BadRequestError,
ConflictError,
Elasticsearch,
NotFoundError,
)


def read_env() -> Dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from langchain.globals import set_llm_cache
from langchain_core.language_models import BaseChatModel

from langchain_elasticsearch import ElasticsearchCache, ElasticsearchEmbeddingsCache
from langchain_elasticsearch import (
ElasticsearchCache,
ElasticsearchEmbeddingsCache,
)

from ._test_utilities import clear_test_indices, create_es_client, read_env

Expand Down
5 changes: 4 additions & 1 deletion libs/elasticsearch/tests/unit_tests/_sync/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
from langchain_core.load import dumps
from langchain_core.outputs import Generation

from langchain_elasticsearch import ElasticsearchCache, ElasticsearchEmbeddingsCache
from langchain_elasticsearch import (
ElasticsearchCache,
ElasticsearchEmbeddingsCache,
)


def serialize_encode_vector(vector: Any) -> str:
Expand Down

0 comments on commit 9a17eb5

Please sign in to comment.