> For the complete documentation index, see [llms.txt](https://docs.dbnl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnl.com/v0.24.x/reference/python-sdk/dbnl.util.md).

# dbnl.util

### get\_column\_schemas\_from\_dataframe

```python
dbnl.util.get_column_schemas_from_dataframe(df: DataFrame) → list[RunSchemaColumnSchemaDict]
```

### get\_default\_components\_dag\_from\_column\_schemas

```python
dbnl.util.get_default_components_dag_from_column_schemas(column_schemas: Sequence[ColumnSchemaDict]) → dict[str, list[str]] | None
```

Gets the unconnected components DAG from a list of column schemas. If there are no components, returns None.\
The default components dag is of the form\
{

> “component1”: \[],\
> “component2”: \[],\
> …}

* **Parameters:column\_schemas** – list of column schemas
* **Returns:**\
  dictionary of components DAG or None

### get\_run\_schema\_columns\_from\_dataframe

```python
dbnl.util.get_run_schema_columns_from_dataframe(df: DataFrame) → list[RunSchemaColumnSchema]
```

### get\_run\_schema\_scalars\_from\_dataframe

```python
dbnl.util.get_run_schema_scalars_from_dataframe(df: DataFrame) → list[RunSchemaScalarSchema]
```

### get\_scalar\_schemas\_from\_dataframe

```python
dbnl.util.get_scalar_schemas_from_dataframe(df: DataFrame) → list[RunSchemaScalarSchemaDict]
```

### make\_test\_session\_input

```python
dbnl.util.make_test_session_input(*, run: Run | None = None, run_query: RunQuery | None = None, run_alias: str = 'EXPERIMENT') → TestSessionInput
```

Create a TestSessionInput object from a Run or a RunQuery. Useful for creating TestSessions right after closing a Run.

* **Parameters:**
  * **run** – The Run to create the TestSessionInput from
  * **run\_query** – The RunQuery to create the TestSessionInput from
  * **run\_alias** – Alias for the Run, must be ‘EXPERIMENT’ or ‘BASELINE’, defaults to “EXPERIMENT”
* **Raises:DBNLInputValidationError** – If both run and run\_query are None
* **Returns:**\
  TestSessionInput object
