Skip to content

Commit 2b0564f

Browse files
author
Andrei Bratu
committed
mypy error fixes
1 parent 7c2ea5e commit 2b0564f

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/humanloop/decorators/tool.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ def _build_function_parameters_property(func) -> _JSONSchemaFunctionParameters:
168168
inspect.Parameter.VAR_POSITIONAL,
169169
inspect.Parameter.VAR_KEYWORD,
170170
):
171-
raise ValueError(
172-
f"{func.__name__}: *args and **kwargs are not supported by the @tool decorator"
173-
)
171+
raise ValueError(f"{func.__name__}: *args and **kwargs are not supported by the @tool decorator")
174172

175173
for parameter in signature.parameters.values():
176174
try:
@@ -337,9 +335,7 @@ def _parse_annotation(annotation: typing.Type) -> _ParsedAnnotation:
337335
# Union has sub_types and is Optional
338336
return _ParsedOptionalAnnotation(
339337
annotation=_ParsedUnionAnnotation(
340-
annotation=[
341-
_parse_annotation(sub_type) for sub_type in sub_types[:-1]
342-
],
338+
annotation=[_parse_annotation(sub_type) for sub_type in sub_types[:-1]],
343339
)
344340
)
345341
# Union type that is not Optional
@@ -373,10 +369,7 @@ def _annotation_parse_to_json_schema(
373369

374370
if isinstance(arg, _ParsedUnionAnnotation):
375371
arg_type = {
376-
"anyOf": [
377-
_annotation_parse_to_json_schema(sub_type)
378-
for sub_type in arg.annotation
379-
],
372+
"anyOf": [_annotation_parse_to_json_schema(sub_type) for sub_type in arg.annotation],
380373
}
381374

382375
elif isinstance(arg, _ParsedTupleAnnotation):
@@ -391,10 +384,7 @@ def _annotation_parse_to_json_schema(
391384
else:
392385
arg_type = {
393386
"type": "array",
394-
"items": [
395-
_annotation_parse_to_json_schema(sub_type)
396-
for sub_type in arg.annotation
397-
],
387+
"items": [_annotation_parse_to_json_schema(sub_type) for sub_type in arg.annotation],
398388
}
399389

400390
elif isinstance(arg, _ParsedListAnnotation):
@@ -464,8 +454,8 @@ def _annotation_parse_to_json_schema(
464454
if isinstance(arg, _ParsedUnionAnnotation):
465455
for type_option in arg_type["anyOf"]:
466456
if (
467-
isinstance(type_option["type"], list)
468-
and "null" not in type_option["type"]
457+
isinstance(type_option["type"], list) # type: ignore
458+
and "null" not in type_option["type"] # type: ignore
469459
): # type: ignore
470460
type_option["type"] = [*type_option["type"], "null"] # type: ignore
471461
elif not isinstance(type_option["type"], list): # type: ignore

src/humanloop/eval_utils/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def upload_callback(log: dict):
504504
logger.debug(
505505
"process_datapoint on Thread %s: function_ %s is a simple callable, context was not consumed",
506506
threading.get_ident(),
507-
function_.__name__,
507+
function_.__name__, # type: ignore
508508
)
509509
log_func(
510510
inputs=datapoint.inputs,

0 commit comments

Comments
 (0)