core: Add ruff rules PYI (#29335)

See https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
Christophe Bornet
2025-04-04 21:59:44 +02:00
committed by GitHub
parent d8e3b7667f
commit 6650b94627
15 changed files with 78 additions and 66 deletions

View File

@@ -994,12 +994,12 @@ 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: # noqa: FA102
def magic_function(input: int | str) -> str: # noqa: FA102
"""Compute a magic function."""
result = convert_to_openai_function(magic_function)
assert result["parameters"]["properties"]["input"] == {
"anyOf": [{"type": "integer"}, {"type": "number"}]
"anyOf": [{"type": "integer"}, {"type": "string"}]
}