codespell: workflow, config + some (quite a few) typos fixed (#6785)

Probably the most  boring PR to review ;)

Individual commits might be easier to digest

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
Yaroslav Halchenko
2023-07-12 16:20:08 -04:00
committed by GitHub
parent 931e68692e
commit 0d92a7f357
100 changed files with 213 additions and 127 deletions

View File

@@ -67,7 +67,7 @@ def test_sql_database_sequential_chain_run() -> None:
def test_sql_database_sequential_chain_intermediate_steps() -> None:
"""Test that commands can be run successfully SEQUENTIALLY and returned
in correct format. sWith Intermediate steps"""
in correct format. switch Intermediate steps"""
engine = create_engine("sqlite:///:memory:")
metadata_obj.create_all(engine)
stmt = insert(user).values(user_id=13, user_name="Harrison", user_company="Foo")

View File

@@ -21,7 +21,7 @@ def test_get_nfts_valid_contract() -> None:
)
result = BlockchainDocumentLoader(contract_address).load()
print("Tokens returend for valid contract: ", len(result))
print("Tokens returned for valid contract: ", len(result))
assert len(result) == max_alchemy_tokens, (
f"Wrong number of NFTs returned. "
@@ -43,7 +43,7 @@ def test_get_nfts_with_pagination() -> None:
startToken=startToken,
).load()
print("Tokens returend for contract with offset: ", len(result))
print("Tokens returned for contract with offset: ", len(result))
assert len(result) > 0, "No NFTs returned"
@@ -57,7 +57,7 @@ def test_get_nfts_polygon() -> None:
contract_address, BlockchainType.POLYGON_MAINNET
).load()
print("Tokens returend for contract on Polygon: ", len(result))
print("Tokens returned for contract on Polygon: ", len(result))
assert len(result) > 0, "No NFTs returned"

View File

@@ -1,4 +1,4 @@
"""Test Clarifai vectore store functionality."""
"""Test Clarifai vector store functionality."""
import time
from langchain.docstore.document import Document

View File

@@ -201,7 +201,7 @@ def test_agent_tool_return_direct_in_intermediate_steps() -> None:
def test_agent_with_new_prefix_suffix() -> None:
"""Test agent initilization kwargs with new prefix and suffix."""
"""Test agent initialization kwargs with new prefix and suffix."""
fake_llm = FakeListLLM(
responses=["FooBarBaz\nAction: Search\nAction Input: misalignment"]
)

View File

@@ -1,4 +1,4 @@
"""Test the loading function for evalutors."""
"""Test the loading function for evaluators."""
from unittest.mock import MagicMock

View File

@@ -1,4 +1,4 @@
"""Test the loading function for evalutors."""
"""Test the loading function for evaluators."""
import pytest

View File

@@ -22,17 +22,18 @@ from langchain.tools.openapi.utils.api_models import (
)
from langchain.tools.openapi.utils.openapi_utils import HTTPVerb, OpenAPISpec
_DIR = Path(__file__).parent
SPECS_DIR = Path(__file__).parents[2] / "examples" / "test_specs"
def _get_test_specs() -> Iterable[Path]:
"""Walk the test_specs directory and collect all files with the name 'apispec'
in them.
"""
test_specs_dir = _DIR / "test_specs"
if not SPECS_DIR.exists():
raise ValueError
return (
Path(root) / file
for root, _, files in os.walk(test_specs_dir)
for root, _, files in os.walk(SPECS_DIR)
for file in files
if file.startswith("apispec")
)
@@ -84,7 +85,7 @@ def test_parse_api_operations(
try:
APIOperation.from_openapi_spec(spec, path, method)
except Exception as e:
raise AssertionError(f"Error processong {spec_name}: {e} ") from e
raise AssertionError(f"Error processing {spec_name}: {e} ") from e
@pytest.fixture

View File

@@ -84,7 +84,7 @@ def test_unannotated_base_tool_raises_error() -> None:
def test_misannotated_base_tool_raises_error() -> None:
"""Test that a BaseTool with the incorrrect typehint raises an exception.""" ""
"""Test that a BaseTool with the incorrect typehint raises an exception.""" ""
with pytest.raises(SchemaAnnotationError):
class _MisAnnotatedTool(BaseTool):
@@ -564,7 +564,7 @@ def test_tool_with_kwargs() -> None:
def test_missing_docstring() -> None:
"""Test error is raised when docstring is missing."""
# expect to throw a value error if theres no docstring
# expect to throw a value error if there's no docstring
with pytest.raises(AssertionError, match="Function must have a docstring"):
@tool