rapidsai / node

GPU-accelerated data science and visualization in node

Home Page:https://rapidsai.github.io/node/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with empty DataFrames

bryevdv opened this issue · comments

There are two cases that lead small issues relate to empty DataFrames:

No arguments to DataFrame
> {DataFrame} = require("@rapidsai/cudf")

> const df = new DataFrame()
Uncaught TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at _seriesToColumns (/opt/node-rapids/modules/cudf/build/js/data_frame.js:31:41)
    at new DataFrame (/opt/node-rapids/modules/cudf/build/js/data_frame.js:95:110)

Presumably this should function identically to new DataFrame({}), which does work

numRows on empty DataFrame
> {DataFrame} = require("@rapidsai/cudf")

> new DataFrame({}).numRows 
Uncaught TypeError: Cannot read property 'length' of undefined
    at DataFrame.get numRows [as numRows] (/opt/node-rapids/modules/cudf/build/js/data_frame.js:112:54)

should return 0