Skip to main content
Applies to:
  • Plan:
  • Deployment:

Summary

Issue: When using EvalAsync with a parent context, the experiment sidebar shows “Rows not attached to a dataset” and the dataset activity tab shows “No experiment that used this dataset was found.” Cause: Passing parent=parent_ctx to EvalAsync prevents it from creating a new experiment, so dataset linkage is never recorded and the experiment created by braintrust.init() has no dataset parameter set. Resolution: Pass dataset=dataset to braintrust.init() to register the dataset ID and version on the experiment.

Resolution Steps

If you are using EvalAsync with a parent context, pass dataset to braintrust.init()

Add dataset=dataset to your init() call. This records the dataset ID and current version on the experiment before EvalAsync runs.
dataset = braintrust.init_dataset(
    project_id=self.project_id,
    name=self.config.dataset.name,
)

experiment = braintrust.init(
    project_id=self.project_id,
    experiment=self.config.experiment.name,
    metadata=experiment_metadata,
    dataset=dataset,  # Required to link dataset to this experiment
)

parent_ctx = experiment.export() if experiment else None
await braintrust.EvalAsync(
    ...,
    data=dataset,
    parent=parent_ctx,
)
After this change:
  • The experiment sidebar shows the linked dataset name and version.
  • The dataset activity tab lists experiments that used the dataset.

If you need to pin to a specific dataset version

Pass version to init_dataset()
dataset = braintrust.init_dataset(
    project_id=self.project_id,
    name=self.config.dataset.name,
    version="<version_string>",
)
The version string is visible on the Datasets page. Experiments automatically pin to the dataset version at run time when dataset is passed to init().