Skip to content

Commit 207e41b

Browse files
author
Andrei Bratu
committed
Rebase fixes
1 parent 27a4ad2 commit 207e41b

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/humanloop/eval_utils/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ def _is_evaluated_file(
106106
The user of the .log API can refer to the File that owns that Log either by
107107
ID or Path. This function matches against any of them in EvaluationContext.
108108
"""
109+
if evaluation_context == {}:
110+
return False
109111
return evaluation_context.get("file_id") == log_args.get(file_id_attribute) or evaluation_context.get(
110112
"path"
111113
) == log_args.get("path")
112114

113115
# Copy the original log method in a hidden attribute
114-
client._log = client.log
116+
client._log = client.log # type: ignore
115117

116118
def _overloaded_log(
117119
self,

src/humanloop/evaluations/client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from .requests.create_evaluation_request_evaluators_item import (
1515
CreateEvaluationRequestEvaluatorsItemParams,
1616
)
17-
from ..requests.evaluations_request import EvaluationsRequestParams
1817
from ..requests.file_request import FileRequestParams
1918
from ..core.serialization import convert_and_respect_annotation_metadata
2019
from .requests.add_evaluators_request_evaluators_item import (
@@ -26,11 +25,6 @@
2625
from .requests.create_run_request_version import CreateRunRequestVersionParams
2726
from ..types.evaluation_run_response import EvaluationRunResponse
2827
from ..types.evaluation_status import EvaluationStatus
29-
from ..requests.evaluations_dataset_request import EvaluationsDatasetRequestParams
30-
from ..requests.version_specification import VersionSpecificationParams
31-
from ..types.logs_association_type import LogsAssociationType
32-
from ..types.evaluation_run_response import EvaluationRunResponse
33-
from ..types.evaluation_status import EvaluationStatus
3428
from ..types.evaluation_stats import EvaluationStats
3529
from ..types.paginated_data_evaluation_log_response import (
3630
PaginatedDataEvaluationLogResponse,

src/humanloop/otel/helpers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def write_to_opentelemetry_span(
105105
# OTel does not allow lists of complex objects, so we linearise them
106106
# by mapping each dict to an index key and recursing into the dict
107107
for idx, list_value in enumerate(value):
108-
work_stack.append((f"{key}.{idx}" if key else idx, list_value))
108+
work_stack.append((f"{key}.{idx}" if key else idx, list_value)) # type: ignore
109109
else:
110110
linearised_attributes[key] = value # type: ignore
111111
for final_key, final_value in linearised_attributes.items():
@@ -232,12 +232,13 @@ def pseudo_to_list(sub_dict):
232232
result = pseudo_to_list(result)
233233
if "" in result:
234234
# User read the root of attributes
235-
return result[""]
235+
return result[""] # type: ignore
236236

237237
for part in key.split("."):
238238
if str.isnumeric(part):
239-
part = int(part)
240-
result = result[part] # type: ignore
239+
result = result[int(part)] # type: ignore
240+
else:
241+
result = result[part] # type: ignore
241242

242243
return result
243244

0 commit comments

Comments
 (0)