Repository navigation
fix(eval): accept callable data factory objects - #1018
Bin (xlb3055) wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Hey Bin (@xlb3055) thanks for the PR! What was the motivation behind this change? |
|
Thanks for asking. The concrete failure is with a zero-argument callable data factory object, which The change recognizes those callable factories while leaving |
|
Bin (@xlb3055) I’m more interested how you ran into this. How are you using braintrust evals in your projects? |
|
Thanks for clarifying, Abhijeet Prasad (@AbhiPrasad). This issue came from an AI-assisted review of the SDK's evaluation data-loading paths while exploring open-source evaluation tooling, followed by a local reproducer. It was not reported from a production Braintrust integration. The starting point was the mismatch between the callable factory accepted by My earlier reply explained the technical failure and potential uses of callable factories, but did not answer your question about how this was encountered. The example here is a local regression case, not a claim of an existing deployed workflow. I hope that makes the contribution's context clearer. |
Summary
EvalandEvalAsyncaccept zero-argument callable data factories throughEvalData, but the runner only invokes objects recognized byinspect.isfunctionorinspect.isroutine. A factory instance implementing__call__is instead iterated and raisesTypeError, aborting the evaluation before any case runs.functools.partialfactories also fail on Python 3.12.Use
callableto recognize data factories, preservingDatasetiteration as the existing workflow evaluator does. Public signatures are unchanged.Regression Coverage
Ten parameterized cases exercise both public evaluation APIs with a callable instance,
functools.partial, a function, an iterator, and a list. They check single factory invocation, case order, task outputs, and scores.inspect.isroutine.nox -s test_core: 1131 passed, 106 skipped, 12 xfailed.The new tests use local data/tasks/scorers,
no_send_logs=True, and disabled caching. No model downloads or live provider requests are needed. The full provider/Python CI matrix and full nox pylint session have not been run locally.Related to #917 only in the data-resolution area: that PR resolves awaitable data; this change recognizes synchronous callable factories and does not add awaitable handling.
AI assistance was used for investigation, implementation, tests, and this description.