Skip to content

[Bug] DataFrame.toJson() value column detection drops all other columns #2045

Description

@Jolanrensen

Based on #2037 (comment)

Turning a DataFrame into JSON ignores all columns that are not value- or array columns if they exist:

If we read

DataFrame.readJsonStr( """[1,{"label":"record"},null]""")

we get:

     String?   Int?
        ----   ----
  0     null      1
  1   record   null
  2     null   null

and then .toJson():

[1,null,null]

label: "record" has been lost.

Expected behavior

DataFrame.readJsonStr( """[1,{"label":"record"},null]""").toJson()

should return values from (correctly recognized) array and value columns back into the JSON array, like:

[1,{"label":"record"},null]

(Related: #2046 our array column detection is completely broken because it checks for null values, however, array columns are created with emptyList() instead.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions