Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install and use ruff format instead of black for code formatting. #12585

Merged
merged 13 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust mypy type ignores to match prior semantics.
  • Loading branch information
obi1kenobi committed Oct 30, 2023
commit 0a15dd9347c19be0f85ae2116ff2fe8bb7a638ac
4 changes: 2 additions & 2 deletions libs/langchain/langchain/callbacks/argilla_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> None:
},
}
for prompt, output in zip(
prompts,
chain_output_val, # type: ignore
prompts, # type: ignore
chain_output_val,
)
]
)
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain/langchain/vectorstores/azuresearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _get_search_client(
}
if len(missing_fields) > 0:
# Helper for formatting field information for each missing field.
def fmt_err(x):
def fmt_err(x: str) -> str:
return (
f"{x} current type: '{fields_types.get(x, 'MISSING')}'. "
f"It has to be '{mandatory_fields.get(x)}' or you can point "
Expand Down
4 changes: 2 additions & 2 deletions libs/langchain/tests/unit_tests/agents/test_initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def test_initialize_agent_with_str_agent_type() -> None:
"""Test initialize_agent with a string."""
fake_llm = FakeLLM()
agent_executor = initialize_agent(
[my_tool],
[my_tool], # type: ignore[list-item]
fake_llm,
"zero-shot-react-description", # type: ignore
"zero-shot-react-description", # type: ignore[arg-type]
)
assert agent_executor.agent._agent_type == AgentType.ZERO_SHOT_REACT_DESCRIPTION
assert isinstance(agent_executor.tags, list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,11 @@ def foo(x: int) -> None:

# Try specifying some
RunnableLambda(foo).with_types(
output_type=List[int],
input_type=List[int], # type: ignore
output_type=List[int], # type: ignore[arg-type]
input_type=List[int], # type: ignore[arg-type]
)
RunnableLambda(foo).with_types(
output_type=Sequence[int],
output_type=Sequence[int], # type: ignore[arg-type]
input_type=Sequence[int], # type: ignore[arg-type]
)

Expand Down
Loading