core: Add ruff rules G, FA, INP, AIR and ISC (#29334)

Fixes mostly for rules G. See
https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
This commit is contained in:
Christophe Bornet
2025-03-31 16:05:23 +02:00
committed by GitHub
parent e4515f308f
commit 026de908eb
10 changed files with 47 additions and 32 deletions

View File

@@ -862,7 +862,7 @@ def test_get_output_messages_with_value_error() -> None:
with_history.bound.invoke([HumanMessage(content="hello")], config)
excepted = (
"Expected str, BaseMessage, List[BaseMessage], or Tuple[BaseMessage]."
+ (f" Got {illegal_bool_message}.")
f" Got {illegal_bool_message}."
)
assert excepted in str(excinfo.value)
@@ -874,6 +874,6 @@ def test_get_output_messages_with_value_error() -> None:
with_history.bound.invoke([HumanMessage(content="hello")], config)
excepted = (
"Expected str, BaseMessage, List[BaseMessage], or Tuple[BaseMessage]."
+ (f" Got {illegal_int_message}.")
f" Got {illegal_int_message}."
)
assert excepted in str(excinfo.value)

View File

@@ -994,7 +994,7 @@ def test__convert_typed_dict_to_openai_function_fail(typed_dict: type) -> None:
)
def test_convert_union_type_py_39() -> None:
@tool
def magic_function(input: int | float) -> str:
def magic_function(input: int | float) -> str: # noqa: FA102
"""Compute a magic function."""
result = convert_to_openai_function(magic_function)