File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change 1414from .requests .create_evaluation_request_evaluators_item import (
1515 CreateEvaluationRequestEvaluatorsItemParams ,
1616)
17- from ..requests .evaluations_request import EvaluationsRequestParams
1817from ..requests .file_request import FileRequestParams
1918from ..core .serialization import convert_and_respect_annotation_metadata
2019from .requests .add_evaluators_request_evaluators_item import (
2625from .requests .create_run_request_version import CreateRunRequestVersionParams
2726from ..types .evaluation_run_response import EvaluationRunResponse
2827from ..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
3428from ..types .evaluation_stats import EvaluationStats
3529from ..types .paginated_data_evaluation_log_response import (
3630 PaginatedDataEvaluationLogResponse ,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments