evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
3.44k stars 167 forks source link

DataTable will not render if a column has only null values and a fmt defined #1847

Closed mjbloch closed 2 weeks ago

mjbloch commented 1 month ago

Steps To Reproduce

index.md

```sql test_error
    select 
        1 as value1,
        null as valueNull
```

<DataTable data={test_error}>
    <Column id=value1 fmt=num0/>
    <Column id=valueNull fmt=num0/>
</DataTable>

```sql test_no_error
    select 
        1 as value1,
        null as valueNull
```

<DataTable data={test_no_error}>
    <Column id=value1 fmt=num0/>
    <Column id=valueNull/>
</DataTable>

Environment

Expected Behavior

Would expect to see all rows showing the null dashed line - for the formatted column.

Actual Behaviour

Entire table does not render as a result of single column. Shows this error message: image

Workarounds

Coalesce nulls to a valid value.