[Bug] `DataFrame.toJson()` does not recognize array columns correctly
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
Related to https://github.com/Kotlin/dataframe/issues/2045
```kt
DataFrame.readJsonStr("""[{"label":"record"},[123]]""")
```
turn into
```
label array
String? List
---- ----
0 record [ ]
1 null [123]
```
while the array-column detection of `toJson()` does not correctly mark `array` as an array-column; it assumes the values in the `array` column must be `null` when other columns have values.
So we get:
```kt
df.toJson()
```
```json
[{"label":"record","array":[]},{"label":null,"array":[123]}]
```
Expected behavior is to have it return to its original state.
Should be solved together with https://github.com/Kotlin/dataframe/issues/2048
Contributor guide
Assessment
This issue has not been assessed yet.