create_test_generation_session

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.

Only applies to Tests generated by Distributional, not custom Tests

Parameters

Arguments
Description

run

The 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

Type
Description

TestGenerationSession

The TestGenerationSession object that was created. The status can be checked to determine when test generation is complete.

Examples

The following 2 examples are equivalent:

run = dbnl.get_run(...)
dbnl.experimental.create_test_generation_session(
  run=run,
  columns=["col1", "col4"],
)
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:

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

Was this helpful?