# create\_test\_generation\_session

```python
def create_test_generation_session(
    *,
    run: Run,
    columns: Optional[list[str | dict[Literal["name"], str]]] = None,
) -> TestGenerationSession
```

If a TestSession has completed and some of the generated Tests had incorrect outcomes, you can tell Distributional that these tests should have had different results.

{% hint style="info" %}
Only applies to Tests generated by Distributional, not custom Tests
{% endhint %}

## Parameters

| Arguments | Description                                                                                                                                                                                                                  |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run`     | The [Run](https://docs.dbnl.com/v0.20.x/using-distributional/python-sdk/sdk-objects/run) to use when generating tests.                                                                                                       |
| `columns` | Either a list of column names or a list of dictionaries with only 1 key, "name". These names must refer to the columns in the Run that dbnl will use to generate Tests. If `None`, then all columns in the Run will be used. |

## Returns

<table><thead><tr><th width="300">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>TestGenerationSession</code></td><td>The TestGenerationSession object that was created. The <code>status</code> can be checked to determine when test generation is complete.</td></tr></tbody></table>

## Examples

The following 2 examples are equivalent:

```python
run = dbnl.get_run(...)
dbnl.experimental.create_test_generation_session(
  run=run,
  columns=["col1", "col4"],
)
```

```python
run = dbnl.get_run(...)
dbnl.experimental.create_test_generation_session(
  run=run,
  columns=[
    {"name": "col1"},
    {"name": "col4"},
  ],
)
```

To generate tests for all columns, leave `columns` out:

```python
run = dbnl.run(...)
dbnl.experimental.create_test_generation_session(
  run=run,
)
```
